filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
2839.ps1 | function CreateConfigurationForNewContext {
param(
[string] $buildFile,
[string] $framework
)
$previousConfig = GetCurrentConfigurationOrDefault
$config = new-object psobject -property @{
buildFileName = $previousConfig.buildFileName;
framework = $previousConfig.framewo... | 0 |
Test-ADCredentials_1.ps1 | Function Test-ADCredentials {
Param($username, $password, $domain)
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
$ct = [System.DirectoryServices.AccountManagement.ContextType]::Domain
$pc = New-Object System.DirectoryServices.AccountManagement.PrincipalContext($ct, $domain)
New-Object PSOb... | 0 |
sample_49_22.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | 0 |
sample_48_98.ps1 | #
# Module manifest for module 'OCI.PSModules.Jmsjavadownloads'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jmsjavadownloads.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported... | 0 |
get-netstat 1.3.ps1 | $netstat = netstat -a -n -o | where-object { $_ -match "(UDP|TCP)" }
[regex]$regexTCP = '(?<Protocol>\\S+)\\s+((?<LAddress>(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?))|(?<LAddress>\\[?[0-9a-fA-f]{0,4}(\\:([0-9a-fA-f]{0,4})){1... | 0 |
3239.ps1 |
class Response {
[Severity]$Severity = [Severity]::Success
[string[]]$Text
[string]$MessageFrom
[string]$To
[Message]$OriginalMessage = [Message]::new()
[pscustomobject[]]$Data = @()
Response() {}
Response([Message]$Message) {
$this.MessageFrom = $Message.From
$this.T... | 0 |
sample_11_49.ps1 | ConvertFrom-StringData @'
id_ctsdnsserver=DNS Server
id_ctsdnsserverdescription=Collects information about DNS Server.
'@
# SIG # Begin signature block
# MIIoOAYJKoZIhvcNAQcCoIIoKTCCKCUCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAI... | 0 |
VerifyCategoryRule_3.ps1 | ## From Windows PowerShell Cookbook (O'Reilly)
## by Lee Holmes (http://www.leeholmes.com/guide)
Set-StrictMode -Version Latest
if($message.Body -match "book")
{
[Console]::WriteLine("This is a message about the book.")
}
else
{
[Console]::WriteLine("This is an unknown message.")
}
| 0 |
2344.ps1 | $remove_ous = $false
$ous_to_keep = @('UAP - PEAP TLS','UAP - PEAP TLS Only','Disabled Users');
$ad_objects = Get-ADObject -Filter "ObjectClass -eq 'user' -or ObjectClass -eq 'computer' -or ObjectClass -eq 'group' -or ObjectClass -eq 'organizationalUnit'";
$aOuDns = @();
foreach ($o in $ad_objects) {
$sDn = $o.Dist... | 0 |
Route.psm1.ps1 | None | 0 |
3423.ps1 |
function Test-AzureLocation
{
$providerLocations = Get-AzureRmLocation
Assert-True { $providerLocations.Count -gt 0 }
foreach ($location in $providerLocations)
{
Assert-True { $location.Providers.Count -gt 0 }
}
} | 0 |
sample_25_71.ps1 | # ---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------------------------... | 0 |
sample_63_8.ps1 | # Get the version of the Torizon IDE Extension from package.json
$env:TEST_EXTENSION_VERSION = ((Get-Content "package.json" -Raw) | ConvertFrom-Json).version
$env:TEST_VSCODE_CLEANUP = $true
# Start the tests from a clean environment, unless explictly setting to false
# the env variable
if ($env:TEST_VSCODE_CLEANUP -E... | 0 |
3402.ps1 |
function Test-AvailabilitySet
{
$rgname = Get-ComputeTestResourceName
try
{
$loc = Get-ComputeVMLocation;
New-AzureRmResourceGroup -Name $rgname -Location $loc -Force;
$asetName = 'avs' + $rgname;
$nonDefaultUD = 2;
$nonDefaultFD = 3;
... | 0 |
sample_5_21.ps1 | ConvertFrom-StringData @'
id_ctsnps=Network Policy Server (NPS)
id_ctsnpsdescription=Collects information about Network Policy Server (NPS) [RADIUS/IAS].
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlL... | 0 |
sample_32_95.ps1 | @{
ModuleVersion = '7.0.1'
GUID = '3859ddf6-1713-4701-adf3-477aeaa06333'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Microsoft® Corporation. All rights reserved."
NestedModules="Newtonsoft.Json.dll"
}
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDz... | 0 |
3534.ps1 |
$location = "southeastasia"
$resourceGroupName = "pstestFSRG1bca8f8e"
$vaultName = "PSTestFSRSV1bca8f8e"
$fileShareFriendlyName = "pstestfs1bca8f8e"
$fileShareName = "AzureFileShare;pstestfs1bca8f8e"
$saName = "pstestsa1bca8f8e"
$skuName="Standard_LRS"
$policyName = "AFSBackupPolicy"
... | 0 |
sample_13_6.ps1 | <#
.SYNOPSIS
Simplify data collection and diagnostics for troubleshooting Microsoft Remote Desktop (RDP/RDS/AVD/W365) related issues and a convenient method for submitting and following quick & easy action plans.
.DESCRIPTION
This script is designed to gather information to assist Microsoft Customer Suppo... | 0 |
sample_45_40.ps1 | #
# Module manifest for module 'OCI.PSModules.Networkloadbalancer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Networkloadbalancer.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Sup... | 0 |
sample_61_48.ps1 | param(
[Parameter(Mandatory = $true)] [string] $logPath,
[Parameter(Mandatory = $true)] [string] $tmpPath,
[Parameter(Mandatory = $true)] [boolean] $isUpdate
)
# set error action
$ErrorActionPreference = "SilentlyContinue"
# common functions
function Get-DateTime() {
Get-Date -Format "yyyy-... | 0 |
1015.ps1 |
$random = (New-Guid).ToString().Substring(0,8)
$subscriptionId = "my-azure-subscription-id"
$apimServiceName = "apim-$random"
$resourceGroupName = "apim-rg-$random"
$location = "Japan East"
$organisation = "Contoso"
$adminEmail = "admin@contoso.com"
Select-AzSubscription -SubscriptionId $subscriptionId
New-... | 0 |
Compare SQL Tables II.ps1 | function Convert-TableToList
{
param(
$t,
$colid = 0
)
$t | % {$_.item($colid)}
}
function Compare-Tables
{
param(
$name,
$db1,
$db2,
$exclude = @()
)
# @bernd_k http://pauerschell.blogspot.com/
# requires on sqlise http://sq... | 0 |
Get-EwsEmail.ps1 | $ewsPath = "C:\\Program Files\\Microsoft\\Exchange\\Web Services\\1.1\\Microsoft.Exchange.WebServices.dll"
Add-Type -Path $ewsPath
$ews = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService -ArgumentList "Exchange2007_SP1"
$cred = (Get-Credential).GetNetworkCredential()
$ews.Credentials = New-Object Sy... | 0 |
8eb8f683-4672-43f6-ae5a-77f76eb77c88.ps1 | #You Need Quest AD Powershell Plugin
#You Need VMWare VI Toolkit
$Null = Connect-VIServer Your-VM-Server-Here;
$Servers = New-Object System.Collections.ArrayList
$Null = Get-QADComputer -SearchRoot 'your.domain.com/Path/To/Server/OU' | Select-Object -property Name | Format-Table -HideTableHeaders| Out-String... | 0 |
Set-Prompt.ps1 | # This should go OUTSIDE the prompt function, it doesn't need re-evaluation\n# We're going to calculate a prefix for the window title \n# Our basic title is "PoSh - C:\\Your\\Path\\Here" showing the current path\nif(!$global:WindowTitlePrefix) {\n # But if you're running "elevated" on vista, we want to show that ...\... | 0 |
1354.ps1 |
function Test-COSIs64Bit
{
[CmdletBinding()]
param(
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
return ([Environment]::Is64BitOperatingSystem)
}
| 0 |
sample_44_99.ps1 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apa... | 0 |
sample_18_83.ps1 | # Copyright (c) 2019-2024, The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
param(
[Parameter(Mandatory = $true, HelpMessage = "Path to unzipped openxr_loader_windows OpenXR-SDK release asset")]
$SDKRelease,
[Parameter(Mandatory = $true, HelpMessage = "Path to specification Makefile. Needed to e... | 0 |
sample_57_92.ps1 | #
# Module manifest for module 'OCI.PSModules.Fleetsoftwareupdate'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Fleetsoftwareupdate.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Sup... | 0 |
Create-Certificate.ps1 | #####################################################################
# Create PowerShell cert.ps1
# Version 1.0
#
# Creates self-signed signing certificate and install it to certificate store
#
# Note: Requires at least Windows Vista. Windows XP/Windows Server 2003
# are not supported.
#
# Vadims Podans (c) 2... | 0 |
LDAPLogging_1.ps1 | \nfunction Private:Configure-Logging {\n<#\n .SYNOPSIS\n Enables, disables or view current LDAP Logging settings on a domain controller.\n\n .DESCRIPTION\n Enables, disables or view current LDAP Logging settings on a domain controller.\n \n Use one of the following aliases:\n \n Get-LDAPLo... | 0 |
3864.ps1 |
function Test-GetLegacyKindExchangeAshburn
{
try{
$peerAsn = makePeerAsn 15224;
$legacy = Get-AzLegacyPeering -Kind Exchange -PeeringLocation Ashburn
Assert-NotNull $legacy
Assert-True {$legacy.Count -ge 1}
}finally {
$isRemoved = Remove-AzPeerAsn -Name $peerAsn.Name -Force -PassThru
Assert... | 0 |
Out-SqlLdrCtlFile.ps1 | param($fileName)
Add-Type -Path "C:\\Oracle\\Oracle.ManagedDataAccess.dll"
#Change these values
$userID = "yourOracleUserID"
$password ="yourOraclePassword"
$dataSource ="yourOracleDB"
#Assumes Table name is same as file name without extension
#and ctl file will output to same directory with ctl extension
... | 0 |
sample_21_89.ps1 | # Compiling deqp
$ProgressPreference = "SilentlyContinue"
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
. "$MyPath\mesa_init_msvc.ps1"
$source_dir = Join-Path -Path "$PWD" -ChildPath "src"
$deqp_source = Join-Path -Path "$source_dir" -ChildPath "VK-GL-CTS"
$deqp_build = Join-Path -Path "$PWD" -ChildPath... | 0 |
sample_63_76.ps1 | #
# Module manifest for module 'OCI.PSModules.Resourcemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Resourcemanager.dll'
# Version number of this module.
ModuleVersion = '88.1.0'
# Supported P... | 0 |
ACE.psm1.ps1 | #######################
function Get-ACEConnection
{
param($ConnectionString)
$conn = new-object System.Data.OleDb.OleDbConnection($ConnectionString)
$conn.open()
$conn
} #Get-ACEConnection
#######################
function Get-ACETable
{
param($Connection)
... | 0 |
Get-ProcessCount_2.ps1 | # Get-ProcessCount uses 2 main variables, server and process name.
# Process name is typically the end exe, such as "svchost.exe"
# Will accept unnamed args (Get-ProcessCount servername processname)
# or named args (Get-ProcessCount -Computer servername -Process processname)
Function Get-ProcessCount([string]$proce... | 0 |
sample_17_64.ps1 | ConvertFrom-StringData @'
id_clusterdependencyreport=Cluster resource dependency report
id_clusterdependencyreportdesc1=Obtaining cluster resource dependency report
id_clusterdependencyreportdesc=Obtaining cluster resource dependency report from group %GroupName%
'@
# SIG # Begin signature block
# MIIoUgYJKoZIh... | 0 |
95.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aa... | 0 |
sample_57_76.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
param (
[Parameter(Manda... | 0 |
sample_52_24.ps1 | ConvertFrom-StringData @'
EditorCommandExists=Editor command '{0}' already exists, skipping.
EditorCommandImporting=Importing editor command '{0}'.
MissingEditorContext=Unable to obtain editor context. Make sure PowerShell Editor Services is running and then try the command again.
'@
# SIG # Begin signature bloc... | 0 |
4038.ps1 |
function Test-OriginGetSetWithRunningEndpoint
{
$profileName = getAssetName
$resourceGroup = TestSetup-CreateResourceGroup
$resourceLocation = "EastUS"
$profileSku = "Standard_Verizon"
$createdProfile = New-AzCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.Resou... | 0 |
sample_43_29.ps1 | <#
.SYNOPSIS
For a series of known or specified channels, lists out what would be installed for a given quality level and channel.
.PARAMETER Quality
Optional quality(s) to check
.PARAMETER Channel
Optional channel(s) to check. Otherwise checks a bunch of known channels.
.PARAMETER Component
Optional channel(s) to c... | 0 |
438.ps1 |
$registrationEvent = {
}
$begin_event = {
if (-not (Get-Module -Name 'PSGELF')) {
Import-Module -Name 'PSGELF'
}
}
$start_event = {
$gelf_gelfserver = Get-PSFConfigValue -FullName 'PSFramework.Logging.GELF.GelfServer'
$gelf_port = Get-PSFConfigValue -FullName 'PSFramework.Logging.GELF.Por... | 0 |
sample_55_75.ps1 | # Import the helper functions
Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false
function Get-TargetResource
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param
(
[parameter(Mandatory = $true)]
[System.String]
$Category
)
#Write-Verbose "Use this cmdlet t... | 0 |
1784.ps1 |
Describe "DSC MOF Compilation" -tags "CI" {
AfterAll {
$env:PSModulePath = $_modulePath
}
BeforeAll {
$IsAlpine = (Get-PlatformInfo) -eq "alpine"
Import-Module PSDesiredStateConfiguration
$dscModule = Get-Module PSDesiredStateConfiguration
$baseSchemaPath = Join-P... | 0 |
sample_33_65.ps1 | enum Ensure
{
Present
Absent
}
[DscResource()]
class JeaEndpoint
{
## The optional state that ensures the endpoint is present or absent. The defualt value is [Ensure]::Present.
[DscProperty()]
[Ensure] $Ensure = [Ensure]::Present
## The mandatory endpoint name. Use 'Microsoft.Powe... | 0 |
Logoff all users_1.ps1 | function RemoveSpace([string]$text) {
$private:array = $text.Split(" ", `
[StringSplitOptions]::RemoveEmptyEntries)
[string]::Join(" ", $array) }
$quser = quser
foreach ($sessionString in $quser) {
$sessionString = RemoveSpace($sessionString)
$session = $sessionString.split()
i... | 0 |
3790.ps1 |
function Test-VirtualMachineScaleSet
{
Test-VirtualMachineScaleSet-Common $false
}
function Test-VirtualMachineScaleSet-ManagedDisks
{
Test-VirtualMachineScaleSet-Common $true
}
function Test-VirtualMachineScaleSet-Common($IsManaged)
{
$rgname = Get-ComputeTestResourceName
try
... | 0 |
New-ISEMenu_1.ps1 | Import-Module ShowUI
Function New-ISEMenu {
New-Grid -AllowDrop:$true -Name "ISEAddonCreator" -columns Auto, * -rows Auto,Auto,Auto,*,Auto,Auto -Margin 5 {
New-Label -Name Warning -Foreground Red -FontWeight Bold -Column 1
($target = New-TextBox -Name txtName -Column 1 -Row ($Row=1))
New-Label... | 0 |
sample_66_2.ps1 | $timestamp = get-date -uformat %Y%m%d-%k%M%S
$transcriptPath = "$($env:temp)\StorageSyncAgent-SetRegPIIAclSettings-$($timestamp).log"
Start-Transcript -Path $transcriptPath
# The following script removes read permissions from registry key locations which may contain PII information.
$regPaths = 'HKLM:\Software\Mi... | 0 |
Network Config _ Excel.ps1 | $excel = New-Object -comobject Excel.Application
$excel.visible = $False #Change to True to see the excel build
$wbook = $excel.Workbooks.Add()
$wsheet = $wbook.Worksheets.Item(1)
$wsheet.Cells.Item(1,1) = "Date"
$wsheet.Cells.Item(1,2) = "Server"
$wsheet.Cells.Item(1,3) = "NETID"
$wsheet.Cells.Item(1,4) = "Desc... | 0 |
sample_45_39.ps1 | #
# Module manifest for module 'DscInstall'
#
# Generated by: Zia Jalali
#
# Generated on: 07/31/2017
#
@{
# Script module or binary module file associated with this manifest.
ModuleToProcess = 'Heartbeat.psm1'
# Version number of this module.
ModuleVersion = '1.1'
# ID used to uniquely identify thi... | 0 |
File encoding no BOM.ps1 | #region Function: Get-DTWFileEncoding
<#
.SYNOPSIS
Returns the encoding type of the file
.DESCRIPTION
Returns the encoding type of the file. It first attempts to determine the
encoding by detecting the Byte Order Marker using Lee Holmes' algorithm
(http://poshcode.org/2153). However, if the file does not ha... | 0 |
sample_6_10.ps1 | #************************************************
# TS_PrinterKB2457866Check.ps1
# Version 1.0.1
# Date: 03-27-2011
# Author: v-anecho
# Description: Checks if machine is server 2008 R2 sp0 or sp1, and event log 602 exists, and hotfix kb 2457866 is installed if true generate alert
#******************************... | 0 |
1920.ps1 |
Describe "Get-Runspace cmdlet tests" -Tag "CI" {
BeforeAll {
$CurrentRunspace = $ExecutionContext.Host.Runspace
$ExpectedInstanceId = $CurrentRunspace.InstanceId
$ExpectedId = $currentRunspace.Id
}
It "Get-Runspace should return the current runspace" {
$runspace = get-runsp... | 0 |
1285.ps1 |
function Complete-CJob
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[Management.Automation.Job[]]
[Alias('Jobs')]
$Job,
[Parameter()]
[int]
$IntervalSeconds = 1
)
Use-CallerPreference -Cmdlet $PSCmdlet -... | 0 |
3946.ps1 |
function Test-DnsAvailability
{
$domainQualifiedName = Get-ResourceName
$resourceTypeParent = "Microsoft.Network/publicIPAddresses"
$location = Get-ProviderLocation $resourceTypeParent
$checkdnsavailability = Test-AzDnsAvailability -Location "westus" -DomainQualifiedName $domai... | 0 |
371.ps1 | function Complete
{
[CmdletBinding()]
param (
[string]
$Expression
)
process
{
[System.Management.Automation.CommandCompletion]::CompleteInput(
$Expression,
$Expression.Length,
$null
).CompletionMatches
}
}
Describe 'Completion tests: input' {
It 'can complete input from Get-ChildItem' {
Comp... | 0 |
gpupdate on remote pc's_1.ps1 | ###############################################################################
#
# Get all servers from a OU and run GPUpdate /force on this machines.
#
# Version 1.0
#
# (C) 2009 - Arne Fokkema
# www.ict-freak.nl
#
# Install the Quest AD cmdlets first!!
#
###############################################... | 0 |
sample_20_61.ps1 | "File","Version","SHA256Hash"
"Analyze-SpaceDump.ps1","23.11.21.1852","2812DF7EFD542A050574FB025C557DF26E92C20DC10F070D32F1FA66EA90A6EC"
"Check-SharingStatus.ps1","23.12.05.1815","A7D57727F19D7C52E98564E07AAA2314AD49CEB74CEA7D0F3A2E7FFD684B4291"
"Clear-MailboxPermission.ps1","23.01.13.1832","3989A8F15D29E53C92F111D4... | 0 |
4035.ps1 |
$managementGroup = 'AzGovTest7'
$description = 'Unit test junk: sorry for littering. Please delete me!'
$updatedDescription = "Updated $description"
$metadataName = 'testName'
$metadataValue = 'testValue'
$metadata = "{'$metadataName':'$metadataValue'}"
$enforcementModeDefault = 'Default'
$enforcementMode... | 0 |
sample_8_75.ps1 | ConvertFrom-StringData @'
progressbar_id_crm_org_version_deployment_check=Verifying Organization Databases Revision Not Greater Than Deployment Revision
progressbar_id_crm_org_version_deployment_checkdesc=Verifying Organization Databases Revision Not Greater Than Deployment Revision
'@
# SIG # Begin signature blo... | 0 |
1272.ps1 |
function Remove-CDotNetAppSetting
{
[CmdletBinding(SupportsShouldProcess=$true, DefaultParameterSetName='All')]
param(
[Parameter(Mandatory=$true)]
[string]
$Name,
[Switch]
$Framework,
[Switch]
$Framework64,
... | 0 |
Compare-Property.ps1 | ##############################################################################\n##\n## Compare-Property\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nCompare... | 0 |
4060.ps1 |
[CmdletBinding()]
param
(
[string]$Parameters = 'INSTALL_SILENT=Enable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_ANALYTICS=Disable EULA=Disable REBOOT=Disable'
)
function Get-Architecture {
[CmdletBinding()][OutputType([string])]
param ()
$OSArchitecture = (Get-WmiObject -Class Win32_OperatingSystem | Select-O... | 0 |
749.ps1 | $vstsVariables = @{
PSES_BRANCH = 'master'
}
foreach ($var in $vstsVariables.Keys)
{
if (Get-Item "env:$var" -ErrorAction Ignore)
{
continue
}
$val = $vstsVariables[$var]
Write-Host "Setting var '$var' to value '$val'"
Write-Host "
}
| 0 |
sample_59_32.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="$basedir\..\..\..\..\..\rollup@4.16.1\node_modules"
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node... | 0 |
sample_67_45.ps1 | ##########################################################################
# DELL PROPRIETARY INFORMATION
#
# This software is confidential. Dell Inc., or one of its subsidiaries, has supplied this
# software to you under the terms of a license agreement,nondisclosure agreement or both.
# You may not copy, disclose, o... | 0 |
Manage ASP_1.NET Providers.ps1 | # Manage_ASP_NET_Providers.ps1
# by Chistian Glessner
# http://iLoveSharePoint.com
# have to be initaized. If you want to change the app config you have to restart PowerShell
param($appConfigPath=$(throw "-appConfigPath is mandatory"))
{
# App config path have to be set before loading System.Web.dll
[S... | 0 |
2200e57e-b53f-4e8d-96c9-43d4360ace3e.ps1 | # Environment proprties
[string]$QTDIR = "C:\\Qt\\4.8.3-msvc2008"
[string]$rootDir = "C:\\Build\\"
[string]$buildDir = "C:\\Build\\build_dir\\"
[string]$outputDir = "C:\\Build\\output_dir\\"
[string]$svnDir = "C:\\Build\\build_dir\\vacuum"
[string]$svnUrl = "http://vacuum-im.googlecode.com/svn/trunk/"
[string]... | 0 |
ef87bae5-0285-4381-94e0-6da00a3d4525.ps1 | while($cell.value2.length -ge 0) {
$name = $cell.value2
$sam = $cell.offset(0,1).value2
$givenName = $cell.offset(0,2).value2
$surName = $cell.offset(0,3).value2
$displayName = $cell.offset(0,4).value2
$password = $cell.offset(0, 5).value2
write-host "navn:" $name "`t`t,sam:" $sam "`t,GivenName... | 0 |
Get-LocalGroupMember_3.ps1 | function Get-LocalGroupMember
<#
.Synopsis
Get the local group membership.
.Description
Get the local group membership.
.Parameter ComputerName
Name of the Computer to get group members (Default localhost.)
.Parameter Group
... | 0 |
sample_57_61.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Suppor... | 0 |
2361.ps1 | $aPcs = Get-Content dddd.txt | where
foreach ($oPc in $aPcs) {
$sUser = $oPc.ToLower();
if ($sUser -eq 'isspare23') {
$sLName = 'spare23'
$sLName = "spare23"
$sDisplayName = "spare23 spare23";
$sDesc = 'med cart laptop autologin';
} else {
$sLName = $sUser.substring($sUser.length - 4, 4);
$sLName = "Car... | 0 |
2423.ps1 |
[CmdletBinding()]
param (
[string]$SiteCode = 'UHP',
[ValidateScript({Test-Connection $_ -Quiet -Count 1})]
[string]$SiteDbServer = 'CONFIGMANAGER',
[ValidateScript({ Test-Path $_ -PathType 'Container' })]
[string]$DestDbBackupFolderPath = '\\sanstoragea\lt_archive\30_Days\ConfigMgr',
[ValidateScript({ Test... | 0 |
sample_1_50.ps1 | #************************************************
# DC_CollectSqlErrorlogs.ps1
# Version 1.0.0
# Date: 8-19-2011
# Author: Shon Hauck - Shonh@Microsoft.com
# Description: Collects OS Performance Related Information
# Processor Information
# Operating System Performance Information
#
# NOTE:
#
#***... | 0 |
2797.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT DISTINCT
CreationDate,
ProcessId,
ParentProcessId,
ExecutablePath,
CommandLine,
PSComputerName
FROM
*ProcsWMI.tsv
WHERE
ExecutablePath like '%Temp%' or
ExecutablePath like '%Tm... | 0 |
sample_27_28.ps1 | @{
GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Start-Transcript", "Stop-Transcript"
... | 0 |
sample_66_45.ps1 | @{
GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
FunctionsToExport = @()
CmdletsToExport = "Get-Acl", "Set-Acl", "G... | 0 |
sample_8_47.ps1 | ConvertFrom-StringData @'
id_clusteripv6firewallcheck_st=One or more Windows Firewall rules are disabled on nodes with IPv6 enabled
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAI... | 0 |
4341.ps1 | function Set-PSGalleryRepository
{
[CmdletBinding()]
param(
[Parameter()]
[switch]
$Trusted,
[Parameter()]
$Proxy,
[Parameter()]
$ProxyCredential
)
$psgalleryLocation = Resolve-Location -Location $Script:PSGallerySourceUri `
... | 0 |
4143.ps1 |
param
(
[switch]$SCCM,
[switch]$NetworkShare,
[string]$NetworkSharePath,
[switch]$SCCMImport
)
function Initialize-HardwareInventory {
[CmdletBinding()]
param ()
$Output = "Initiate SCCM Hardware Inventory....."
$SMSCli = [wmiclass] "\\localhost\root\ccm:SMS_Client"
$ErrCode = ($SMSCli.TriggerSchedule("{... | 0 |
sample_43_79.ps1 | /*!---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*----------------------------------------------------------*/
define(["require", "exports"], function (require, exports) {
/// <reference path="../../../Scripts/global.d.ts" />
});
// S... | 0 |
3952.ps1 |
function Test-ListAzureFirewallFqdnTag
{
$alwaysPresentTag = "WindowsUpdate"
$availableFqdnTags = Get-AzFirewallFqdnTag
Assert-True { $availableFqdnTags.Count -gt 0 }
Assert-AreEqual 1 $availableFqdnTags.Where({$_.FqdnTagName -eq $alwaysPresentTag}).Count
}
| 0 |
2104.ps1 |
Describe 'Native UNIX globbing tests' -tags "CI" {
BeforeAll {
if (-Not $IsWindows )
{
"" > "$TESTDRIVE/abc.txt"
"" > "$TESTDRIVE/bbb.txt"
"" > "$TESTDRIVE/cbb.txt"
}
$defaultParamValues = $PSDefaultParameterValues.Clone()
$PSDefaultPa... | 0 |
sample_24_88.ps1 | Signature-Version: 1.0
SHA-256-Digest-Manifest-Main-Attributes: g/TqwshCROFJVmhV1QEn61Fg1W2Oo
tyaowJxbJy6WMI=
SHA-256-Digest-Manifest: bJiZfTAP2OxfUN8sPU7S/F6I50JY2amBwiemYT8lIYg=
Created-By: 1.8.0_112 (Oracle Corporation)
Name: com/microsoft/azure/toolkit/lib/appservice/webapp/WebAppServiceS
ubscription.clas... | 0 |
sample_62_19.ps1 | #
# Module manifest for module 'OCI.PSModules.Dts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dts.dll'
# Version number of this module.
ModuleVersion = '89.0.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
2561.ps1 |
param($path=$(throw 'path is required.'), $serverName, $configFile, [switch]$nolog)
[reflection.assembly]::Load("Microso... | 0 |
3981.ps1 |
function Assert-NotNullOrEmpty
{
param([string]$value)
Assert-False { [string]::IsNullOrEmpty($value) }
}
function Assert-IsInstance
{
param([object] $obj, [Type] $type)
Assert-AreEqual $obj.GetType() $type
}
function Assert-PropertiesCount
{
param([PSCustomObject] $obj, [int] $count)
$prope... | 0 |
sample_42_57.ps1 | #
# Module manifest for module 'ThreadJob'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = '.\Microsoft.PowerShell.ThreadJob.dll'
# Version number of this module.
ModuleVersion = '2.0.3'
# ID used to uniquely identify this module
GUID = '0e7b895d-2fec-43f7-8cae-11... | 0 |
sample_36_6.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | 0 |
189.ps1 | function Remove-StringLatinCharacter
{
[CmdletBinding()]
PARAM (
[Parameter(ValueFromPipeline=$true)]
[System.String[]]$String
)
PROCESS
{
FOREACH ($StringValue in $String)
{
Write-Verbose -Message "$StringValue"
TRY
{
[Text.Encoding]::A... | 0 |
sample_31_73.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Set-ScriptExtent {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding(PositionalBinding = $false, DefaultParameterSetName = '__AllParameterSets')]
param(
[Parameter(Posit... | 0 |
2391.ps1 | function New-SelfSignedCertificateEx
{
[CmdletBinding(DefaultParameterSetName = 'Store')]
param
(
[Parameter(Mandatory, Position = 0)]
[string]$Subject,
[Parameter(Position = 1)]
[DateTime]$NotBefore = [DateTime]::Now.AddDays(-1),
[Parameter(Position = 2)]
[DateTime]$NotAfter = $NotBefore.AddDays(3... | 0 |
218.ps1 | function Get-LocalUser
{
PARAM
(
[Alias('cn')]
[String[]]$ComputerName = $Env:COMPUTERNAME,
[String]$AccountName,
[System.Management.Automation.PsCredential]$Credential
)
$Splatting = @{
Class = "Win32_UserAccount"
Namespace = "root\cimv2"
Filter = "LocalAccount='$True'"
}
If ($PSBoundParam... | 0 |
Ring Monitor.ps1 | #requires -version 2.0
Import-Module Accelerators # http://poshcode.org/762
Import-Module PowerBoots # http://boots.codeplex.com
# http://dynamicdatadisplay.codeplex.com
## You have to get the DynamicDataDisplay control, and put it's DLLs in the PowerBoots folder...
ls "$PowerBootsP... | 0 |
sample_53_25.ps1 | #
# Module manifest for module 'OCI.PSModules.Functions'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Functions.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Co... | 0 |
4479.ps1 |
configuration PSModule_UninstallModuleConfig
{
param
(
[Parameter()]
[System.String[]]
$NodeName = 'localhost',
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String]
$ModuleName
)
Import-DscResource -ModuleName 'PowerShel... | 0 |
Update VM Tools_2.ps1 | ########################################################
# Created by Brian English
# for Charlotte County Government
# No warranty suggested or implied
########################################################
########################################################
#connect to VirtualCenter server (i.e. virtua... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.