full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/tamj0rd2_NewUserScript/New User Form.ps1
New User Form.ps1
#=========================================================================== # README #=========================================================================== # This is a script to create new users written by Tamara Jordan. # You can edit the configuration that this script uses by modifying config.json #==...
PowerShellCorpus/Github/mmdriley_google-api-dotnet-tools/GetDiscoveryDocuments.ps1
GetDiscoveryDocuments.ps1
$discovery_endpoint = 'https://www.googleapis.com/discovery/v1/apis' $discovery_dir = Join-Path $Pwd 'DiscoveryJson' New-Item $discovery_dir -Type Directory -Force | Out-Null $web_client = New-Object System.Net.WebClient $web_client.Headers.Add('X-User-Ip', '0.0.0.0') # Act as external user $apis = $web_c...
PowerShellCorpus/Github/stevedickson_scripts/backupFile.ps1
backupFile.ps1
#Usage: .\backupFile.ps1 -from "backupFile.ps1" -to "backupFile2.ps1" param([string] $from, [string] $to) Copy-Item $from $to
PowerShellCorpus/Github/Tanyatang0_Tanyatang0Repo1104064319.zh-cn/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstoragesandbox2.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1", [string]$parameters ) # Main $errorActionPreference = 'Stop' # Step-1: Download buildcore script to local echo "download build core script to local with source u...
PowerShellCorpus/Github/neilpeterson_nepeters-azure-templates/vmms-manual-scale/support-scripts/scale.ps1
scale.ps1
$cred = Get-Credential Login-AzureRmAccount -Credential $cred New-AzureRmResourceGroupDeployment -TemplateFile ..\azuredeploy.json -ResourceGroupName resource-group -existingVMSSName vmms-name -newCapacity 5
PowerShellCorpus/Github/neilpeterson_nepeters-azure-templates/windows-custom-script-simple/support-scripts/Create-File.ps1
Create-File.ps1
$folder = "c:\temp" $log = "c:\temp\AzureLog.txt" $date = get-date if (!(Test-Path $log)) { New-Item -Path $folder -ItemType Directory New-Item -Path $log -ItemType File Add-Content -Value "NEW LOG: Azure PowerShell Endpoint - $date" -Path $log } else { Add-Content -Value "EXSISITNG LOG: ...
PowerShellCorpus/Github/neilpeterson_nepeters-azure-templates/windows-custom-script-simple/support-scripts/custom-script-powershell.ps1
custom-script-powershell.ps1
$cred = Get-Credential $script = "https://raw.githubusercontent.com/neilpeterson/nepeters-azure-templates/master/windows-custom-script-simple/support-scripts/Create-File.ps1" $run = "Create-File.ps1" $name = "custom-script" $rgroup = "" $vmname = "" $location = "West US" Login-AzureRmAccount -Credential $cred ...
PowerShellCorpus/Github/neilpeterson_nepeters-azure-templates/dotnet-core-music-all-vm/support-scripts/config-sql.ps1
config-sql.ps1
<# .SYNOPSIS .DESCRIPTION .PARAMETER Alias .EXAMPLE #> Param ( [string]$user = "sqladmin", [string]$password = "Password12" ) # firewall netsh advfirewall firewall add rule name="sql" dir=in action=allow protocol=TCP localport=1433 Import-Module SQLPS -DisableNameChecking # create u...
PowerShellCorpus/Github/neilpeterson_nepeters-azure-templates/dotnet-core-music-all-vm/support-scripts/configure-music-app.ps1
configure-music-app.ps1
<# .SYNOPSIS .DESCRIPTION .PARAMETER Alias .EXAMPLE #> Param ( ) # firewall netsh advfirewall firewall add rule name="http" dir=in action=allow protocol=TCP localport=80 #folders New-Item -ItemType Directory c:\temp New-Item -ItemType Directory c:\music # install iis Install-WindowsF...
PowerShellCorpus/Github/neilpeterson_nepeters-azure-templates/windows-custom-script-pegcpu/support-scripts/pegcpu.ps1
pegcpu.ps1
$file = New-Item -Path c:\AzureLog.txt -ItemType File get-date | Out-File $file foreach ($loopnumber in 1..2147483647) {$result=1;foreach ($number in 1..2147483647) {$result = $result * $number};$result}
PowerShellCorpus/Github/neilpeterson_nepeters-azure-templates/windows-contianers-tp5/azure-containers.ps1
azure-containers.ps1
<# .SYNOPSIS Installs Windows container role, Windows Server Core image, and Docker on an Azure Virtual Machine. Because the virtual machine requires a reboot, a scheduled task is created for post re-boot configuration. .DESCRIPTION Installs Windows container role, Windows Server Core image, and Docker on an Azur...
PowerShellCorpus/Github/neilpeterson_nepeters-azure-templates/windows-container-swarm/support-scripts/windows-swarm-setup.ps1
windows-swarm-setup.ps1
$swarmpath = 'c:\swarm' $ip = (Get-NetIPAddress | where {$_.IPAddress -Like '10.0.0.*'})[0] $netsh = "netsh interface portproxy add v4tov4 listenport=2375 listenaddress=$($ip.IPAddress) connectport=2375 connectaddress=127.0.0.1" $swarm = "$swarmpath\swarm.exe join --advertise=$($ip.IPAddress):2375 consul://172.16.0....
PowerShellCorpus/Github/neilpeterson_nepeters-azure-templates/dotnet-core-music-vm-sql-db/support-scripts/configure-music-app.ps1
configure-music-app.ps1
<# .SYNOPSIS .DESCRIPTION .PARAMETER Alias .EXAMPLE #> Param ( [string]$user, [string]$password, [string]$sqlserver ) # firewall netsh advfirewall firewall add rule name="http" dir=in action=allow protocol=TCP localport=80 # folders New-Item -ItemType Directory c:\temp New-Item -ItemTyp...
PowerShellCorpus/Github/neilpeterson_nepeters-azure-templates/windows-dsc-demo-app/support-scripts/create-azure-dsc-package.ps1
create-azure-dsc-package.ps1
$cred = Get-Credential Login-AzureRmAccount -credential $cred Publish-AzureRmVMDscConfiguration -ConfigurationPath .\windows-dsc-iis-app.ps1 -ConfigurationArchivePath .\windows-dsc-iis-app.ps1.zip -AdditionalPath .\demo-app
PowerShellCorpus/Github/neilpeterson_nepeters-azure-templates/windows-dsc-demo-app/support-scripts/windows-dsc-iis-app.ps1
windows-dsc-iis-app.ps1
configuration APP { param ( [string[]]$NodeName = 'localhost' ) node $NodeName { WindowsFeature IIS { Ensure = "Present" Name = "Web-Server" } WindowsFeature IISConsole { Ensure = "Presen...
PowerShellCorpus/Github/OPSTest_E2E_Provision_1485777942471/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstoragesandbox2.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1", [string]$parameters ) # Main $errorActionPreference = 'Stop' # Step-1: Download buildcore script to local echo "download build core script to local with source u...
PowerShellCorpus/Github/aremedis_Filenames/filenames.ps1
filenames.ps1
#Change this variable to the parent directory which you want to retrieve the list of files. #example: # "C:\Scripts" # $parent= "<PARENT>" $output= "<OutputLocation>" #Where do you want to place the outputfile? $txtfile = "$output\files.txt"; #uncomment line 13, and 31 if you want a .csv instead #$csvf...
PowerShellCorpus/Github/jonashw_DevelopmentGuidelines/img/Poker_Hand_build.ps1
Poker_Hand_build.ps1
$inkscape = """C:\Program Files\Inkscape\inkscape.exe""" $ids = "Unknown","Flush","Straight","Ace_High","4_of_a_kind","3_of_a_kind","Full_House","2_Pair","1_Pair","High_Card" $width = 250 $n = 1 Foreach($id in $ids){ $full_id = "Poker_Hand_$id" $filename = "Poker_Hand_Pattern-$($n.ToString("D2"))-$id.png" ...
PowerShellCorpus/Github/9to5IT_PS-ManageInactiveAD/Find-ADEmptyGroups.ps1
Find-ADEmptyGroups.ps1
#requires -version 2 <# .SYNOPSIS Find and manage empty Active Directory groups. .DESCRIPTION This script allows you to find and manage empty security and distribution groups within your AD environment. This script also allows for the management of found groups. Management of empty groups includes one or ...
PowerShellCorpus/Github/9to5IT_PS-ManageInactiveAD/Find-ADInactiveComputers.ps1
Find-ADInactiveComputers.ps1
#requires -version 2 <# .SYNOPSIS Find and manage inactive Active Directory computer objects. .DESCRIPTION This script allows you to specify the criteria required to identify inactive computer objects within your AD environment. This script also allows for the management of found computers. Management of ...
PowerShellCorpus/Github/9to5IT_PS-ManageInactiveAD/Find-ADInactiveUsers.ps1
Find-ADInactiveUsers.ps1
#requires -version 2 <# .SYNOPSIS Find and manage inactive Active Directory users. .DESCRIPTION This script allows you to specify the criteria required to identify inactive users within your AD environment. This script also allows for the management of found users. Management of users includes one or more...
PowerShellCorpus/Github/9to5IT_PS-ManageInactiveAD/Find-ADEmptyOU.ps1
Find-ADEmptyOU.ps1
#requires -version 2 <# .SYNOPSIS Find and manage empty Active Directory OUs. .DESCRIPTION This script allows you to find and manage empty organizational units within your AD environment. This script also allows for the management of found OUs. Management of empty OUs includes one or more of the following...
PowerShellCorpus/Github/OPSTest_E2E_NewRepo_1489449937969/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstoragesandbox2.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1", [string]$parameters ) # Main $errorActionPreference = 'Stop' # Step-1: Download buildcore script to local echo "download build core script to local with source u...
PowerShellCorpus/Github/LawrenceDakai_Powershell-tutorials/hello.ps1
hello.ps1
# The code is from: https://technet.microsoft.com/en-us/library/bb963733.aspx # Filename: hello.ps1 Write-Host Write-Host 'Hello World!' Write-Host "Good-bye World! `n" # end of script
PowerShellCorpus/Github/ivoraphael_aspnet_youtubedownloader/youtubedownloader/packages/jQuery.1.10.2/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Determine the file paths $projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName $origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName if (Test-Path $projectIntelliSense...
PowerShellCorpus/Github/ivoraphael_aspnet_youtubedownloader/youtubedownloader/packages/jQuery.1.10.2/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # VS 11 and above supports the new intellisense JS files $vsVersion = [System.Version]::Parse($dte.Version) $supportsJsIntelliSenseFile = $vsVersion.Major -ge 11 if (-not $supportsJsIntelliSenseFile) { $displayVersio...
PowerShellCorpus/Github/ivoraphael_aspnet_youtubedownloader/youtubedownloader/packages/jQuery.1.10.2/Tools/common.ps1
common.ps1
function Get-Checksum($file) { $cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider" $fileInfo = Get-Item $file trap { ; continue } $stream = $fileInfo.OpenRead() if ($? -eq $false) { # Couldn't open file for reading return $null } $bytes = $...
PowerShellCorpus/Github/ivoraphael_aspnet_youtubedownloader/youtubedownloader/packages/Modernizr.2.6.2/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Update the _references.js file Remove-Reference $scriptsFolderProjectItem $modernizrFileNameRegEx
PowerShellCorpus/Github/ivoraphael_aspnet_youtubedownloader/youtubedownloader/packages/Modernizr.2.6.2/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) if ($scriptsFolderProjectItem -eq $null) { # No Scripts folder Write-Host "No Scripts folder found" exit } # Update the _references.js file AddOrUpdate-Reference $scriptsFolderProjectItem $modernizrFileName...
PowerShellCorpus/Github/ivoraphael_aspnet_youtubedownloader/youtubedownloader/packages/Modernizr.2.6.2/Tools/common.ps1
common.ps1
function AddOrUpdate-Reference($scriptsFolderProjectItem, $fileNamePattern, $newFileName) { try { $referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js") } catch { # _references.js file not found return } if ($referencesFileProject...
PowerShellCorpus/Github/ivoraphael_aspnet_youtubedownloader/youtubedownloader/packages/Newtonsoft.Json.6.0.6/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) # open json.net splash page on package install # don't open if json.net is installed as a dependency try { $url = "http://james.newtonking.com/json" $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) if ($dte2.ActiveWindow.Caption -eq "Package Manager Con...
PowerShellCorpus/Github/ivoraphael_aspnet_youtubedownloader/youtubedownloader/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/ivoraphael_aspnet_youtubedownloader/youtubedownloader/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/OPSTest_E2E_NewRepo_1490002532702/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstoragesandbox2.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1", [string]$parameters ) # Main $errorActionPreference = 'Stop' # Step-1: Download buildcore script to local echo "download build core script to local with source u...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/Deploy-AzureResourceGroup.ps1
Deploy-AzureResourceGroup.ps1
#Requires -Version 3.0 #Requires -Module AzureRM.Resources #Requires -Module Azure.Storage Param( [string] [Parameter(Mandatory=$true)] $ResourceGroupLocation, [string] $ResourceGroupName = 'AzureResourceGroup', [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageCont...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/rdsConfig.ps1
rdsConfig.ps1
Param( [string]$domainAdminUserName, [string]$domainAdminPassword, [string]$domainController, [string]$domainName, [string]$nodeName, [string[]]$SessionHosts, [string[]]$WebAccessHosts, [string[]]$ConnectionBrokers, [string]$CollectionName, [string]$ConnectionString, [string]$RDSCBDNS, ...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/dscext.ps1
dscext.ps1
Configuration Main { [CmdletBinding()] Param ( [string] $NodeName, [string] $domainName, [System.Management.Automation.PSCredential]$domainAdminCredentials ) Import-DscResource -ModuleName PSDesiredStateConfiguration, xActiveDirectory Node $AllNodes.Where{$_.Role -eq "DC"}.Nodename ...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/dscExtRDS2.ps1
dscExtRDS2.ps1
Configuration RdsDeployment { param( [string] $NodeName, [pscredential] $domainAdminCredentials, [string] $domainName, [string] $ConnectionBroker ) Import-DscResource -ModuleName PSDesiredStateConfiguration, xCredSSP Node $AllNodes.Where{$_. Role -eq "RDS2"}.NodeName { Loc...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/dscExtRDS.ps1
dscExtRDS.ps1
Configuration RdsDeployment { param( [string] $NodeName, [pscredential] $domainAdminCredentials, [string] $domainName, [string] $ConnectionBroker ) Import-DscResource -ModuleName PSDesiredStateConfiguration, xCredSSP Node $AllNodes.Where{$_.Role -eq "RDS1"}.NodeName { Lo...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/xCredSSP/1.1.0.0/Tests/Unit/MSFT_xCredSSP.tests.ps1
MSFT_xCredSSP.tests.ps1
<# .Synopsis Unit tests for MSFT_xCredSSP .DESCRIPTION Unit tests for MSFT_xCredSSP .NOTES Code in HEADER and FOOTER regions are standard and may be moved into DSCResource.Tools in Future and therefore should not be altered if possible. #> $Global:DSCModuleName = 'xCredSSP' # Example xNe...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/xActiveDirectory/2.10.0.0/Assert-HADC.ps1
Assert-HADC.ps1
# A configuration to Create High Availability Domain Controller $secpasswd = ConvertTo-SecureString "Adrumble@6" -AsPlainText -Force $domainCred = New-Object System.Management.Automation.PSCredential ("sva-dscdom\Administrator", $secpasswd) $safemodeAdministratorCred = New-Object System.Management.Automation.PSCr...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/xActiveDirectory/2.10.0.0/Assert-ParentChildDomains.ps1
Assert-ParentChildDomains.ps1
$secpasswd = ConvertTo-SecureString "Adrumble@6" -AsPlainText -Force $domainCred = New-Object System.Management.Automation.PSCredential ("sva-dscdom\Administrator", $secpasswd) $safemodeAdministratorCred = New-Object System.Management.Automation.PSCredential ("sva-dscdom\Administrator", $secpasswd) $localcred = New-...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/xActiveDirectory/2.10.0.0/Misc/New-ADDomainTrust.ps1
New-ADDomainTrust.ps1
$Properties = @{ SourceDomain = New-xDscResourceProperty -Name SourceDomainName -Type String -Attribute Key ` -Description 'Name of the AD domain that is requesting the trust' TargetDomain = New-xDscResourceProperty -Nam...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/xActiveDirectory/2.10.0.0/DSCResources/MSFT_xADRecycleBin/Examples/xActiveDirectory_xADRecycleBin.ps1
xActiveDirectory_xADRecycleBin.ps1
Configuration Example_xADRecycleBin { Param( [parameter(Mandatory = $true)] [System.String] $ForestFQDN, [parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $EACredential ) Import-DscResource -Module xActiveDirectory Node $AllNodes.NodeName {...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/xActiveDirectory/2.10.0.0/DSCResources/MSFT_xADRecycleBin/ResourceDesignerScripts/GeneratexADRecycleBinSchema.ps1
GeneratexADRecycleBinSchema.ps1
New-xDscResource -Name MSFT_xADRecycleBin -FriendlyName xADRecycleBin -ModuleName xActiveDirectory -Path . -Force -Property @( New-xDscResourceProperty -Name ForestFQDN -Type String -Attribute Key New-xDscResourceProperty -Name EnterpriseAdministratorCredential -Type PSCredential -Attribute Required New-...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/xActiveDirectory/2.10.0.0/DSCResources/MSFT_xADCommon/MSFT_xADCommon.ps1
MSFT_xADCommon.ps1
data localizedString { # culture="en-US" ConvertFrom-StringData @' RoleNotFoundError = Please ensure that the PowerShell module for role '{0}' is installed MembersAndIncludeExcludeError = The '{0}' and '{1}' and/or '{2}' parameters conflict. The '{0}' parameter should not be u...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/xActiveDirectory/2.10.0.0/Tests/Unit/MSFT_xADDomain.Tests.ps1
MSFT_xADDomain.Tests.ps1
$Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking $Global:DSCResourceName = 'MSFT_xADDomain' # Example MSFT_xFirewall #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) Write-Host $moduleRoot -ForegroundColo...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/xActiveDirectory/2.10.0.0/Tests/Unit/MSFT_xWaitForADDomain.Tests.ps1
MSFT_xWaitForADDomain.Tests.ps1
$Global:DSCModuleName = 'xActiveDirectory' $Global:DSCResourceName = 'MSFT_xWaitForADDomain' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResour...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/xActiveDirectory/2.10.0.0/Tests/Unit/MSFT_xADCommon.Tests.ps1
MSFT_xADCommon.Tests.ps1
$Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking $Global:DSCResourceName = 'MSFT_xADCommon' # Example MSFT_xFirewall #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) Write-Host $moduleRoot -ForegroundColo...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/xActiveDirectory/2.10.0.0/Tests/Unit/MSFT_xADOrganizationalUnit.Tests.ps1
MSFT_xADOrganizationalUnit.Tests.ps1
$Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking $Global:DSCResourceName = 'MSFT_xADOrganizationalUnit' # Example MSFT_xFirewall #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) Write-Host $moduleRoot -Fo...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/xActiveDirectory/2.10.0.0/Tests/Unit/MSFT_xADGroup.Tests.ps1
MSFT_xADGroup.Tests.ps1
$Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking $Global:DSCResourceName = 'MSFT_xADGroup' # Example MSFT_xFirewall #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) Write-Host $moduleRoot -ForegroundColor...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/xActiveDirectory/2.10.0.0/Tests/Unit/MSFT_xADUser.Tests.ps1
MSFT_xADUser.Tests.ps1
$Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking $Global:DSCResourceName = 'MSFT_xADUser' # Example MSFT_xFirewall #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) Write-Host $moduleRoot -ForegroundColor ...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/xActiveDirectory/2.10.0.0/Tests/Unit/MSFT_xADDomainDefaultPasswordPolicy.Tests.ps1
MSFT_xADDomainDefaultPasswordPolicy.Tests.ps1
$Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking $Global:DSCResourceName = 'MSFT_xADDomainDefaultPasswordPolicy' # Example MSFT_xFirewall #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) Write-Host $modul...
PowerShellCorpus/Github/jamesatighe_AzureResourceGroup/AzureResourceGroup/DSC/cRemoteDesktopServices/1.0/Examples/cRemoteDesktopServices/Configuration.ps1
Configuration.ps1
$DscResourcePath = Join-Path -Path $PSScriptRoot -ChildPath 'cRemoteDesktopServices' $ConfigurationFile = Join-Path -Path $PSScriptRoot -ChildPath 'Configuration.psm1' $ConfigDataFile = Join-Path -Path $PSScriptRoot -ChildPath 'Configuration.psd1' $CredentialFile = Join-Path -Path $PSScriptRoot -ChildPath 'C...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Get-TCBuildType.ps1
Get-TCBuildType.ps1
<# .SYNOPSIS Get the build type TeamCity object .DESCRIPTION Build Type also called Build Configuration in TemaCity web interface can be retrieved thanks to autocompletion feature. Juste type the Get-TCBuildType then space and tab to autocomplete the build configuration with TeamCity server build ...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Get-String.ps1
Get-String.ps1
function Get-String { [CmdletBinding(SupportsShouldProcess)] Param ( [Parameter(Mandatory)] [string] $Accept, [Parameter(Mandatory)] [pscredential] $Credential, [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [string] $...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Pin-TCBuild.ps1
Pin-TCBuild.ps1
<# .SYNOPSIS Pin a given build. .DESCRIPTION When a TeamCity build is pinned, this build is never removed. Instead, TeamCity display the amount of used data for pinned build in the data usage configurations .PARAMETER Build The build from the pipeline see example .PARAMETER Dele...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Get-Solution.ps1
Get-Solution.ps1
function Get-Solution { [CmdletBinding(SupportsShouldProcess)] Param ( [Parameter(Mandatory=$false, ValueFromPipelineByPropertyName)] [string] $Name = "", [string] $Path = '.', [pscredential] $Credential ) Process { $Path = Resolve-Path $...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/New-TCFromTemplate.ps1
New-TCFromTemplate.ps1
<# .SYNOPSIS Create a new build type (build configuration) based on a given teamcity template. .DESCRIPTION Given a parent project and a template then create a build type (build configuration) same called as template under parent project .PARAMETER ProjectId Mandatory, aliased Id is th...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Get-TCBadge.ps1
Get-TCBadge.ps1
<# .SYNOPSIS Copy to clipboard the TeamCity build badge .DESCRIPTION When a build is finished, TeamCity display a state SUCCESS, FAILURE or UNKNOWN when cancelled. This cmdlet display the build state for the last build for a given buildType .PARAMETER Id Mandatory, Given a buildTy...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Get-TCResource.ps1
Get-TCResource.ps1
function Get-TCResource { [CmdletBinding(SupportsShouldProcess)] Param ( [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] [string] $Href, [string[]] $Parameters, [pscredential] $Credential, [string] $Server ) Process ...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Download-TCFile.ps1
Download-TCFile.ps1
function Download-TCFile { <# .SYNOPSIS Download artifact file for a given artifact path. .DESCRIPTION When a build is finished, it produce artifact files. Given a finished build, then this cmdlet download the artifact file at given uri. .PARAMETER Folder ...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/New-TCProject.ps1
New-TCProject.ps1
<# .SYNOPSIS Create a new project .DESCRIPTION Given a solution under visual studio into the package manager console targeted a project, then the New-TCProject find the solution ascendant in order to create a project same called as solution name .PARAMETER ParentId aliased Id is the pa...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Start-TCBuild.ps1
Start-TCBuild.ps1
<# .SYNOPSIS Start a build from a build type. .DESCRIPTION Run build from a given build type (build configuration) from the pipeline .PARAMETER BuildType Mandatory, Also called buildTypeId or id. .PARAMETER Wait Switch parameter. When it is set, the cmdlet wait the end of t...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Get-TCTemplate.ps1
Get-TCTemplate.ps1
<# .SYNOPSIS Get Teamcity template for a given project .DESCRIPTION Return template object from teamcity project. .PARAMETER Id Mandatory, Correspond to a project. This cmdlet is used to autocomplete the New-TCFromTemplate parameter .EXAMPLE C:\PS> Get-TCTemplate Net #> f...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Get-TCUri.ps1
Get-TCUri.ps1
function Get-TCUri { [CmdletBinding(SupportsShouldProcess)] Param ( [Parameter(ValueFromPipeline)] [string] $RelativePath = "", [string[]] $Parameters = @(), [string] $Server ) Process { if($Parameters) { $quer...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Remove-TCBuildType.ps1
Remove-TCBuildType.ps1
<# .SYNOPSIS Remove a build configuration. .DESCRIPTION Remove a build configuration. CmdLet use tab expansion in order to retrieve all build configuration from teamcity server .PARAMETER Id The Id property of the build type object from the pipeline .EXAMPLE C:\PS> Remove-T...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Get-FromJson.ps1
Get-FromJson.ps1
function Get-FromJson { [CmdletBinding(SupportsShouldProcess)] Param ( [Parameter(Mandatory)] [pscredential] $Credential, [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [string] $Uri ) Process { return Get-String...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Download-TCArtifacts.ps1
Download-TCArtifacts.ps1
<# .SYNOPSIS Download the zip artifacts. .DESCRIPTION When a build is finished, it produce artifact that can be zipped by TeamCity. Given a finished build, then this cmdlet download the artifacts as zip. .PARAMETER Directory This parameter is set to download. This directory is cre...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/New-TCBuildType.ps1
New-TCBuildType.ps1
<# .SYNOPSIS Create a new build type (build configuration) under a given project. _Root project correspond to the Root TeamCity project .DESCRIPTION Create a new build configuration with the given name under the pipelined project. .PARAMETER ProjectId Mandatory, aliased Id is the proje...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Post-String.ps1
Post-String.ps1
function Post-String { [CmdletBinding(SupportsShouldProcess)] Param ( [Parameter(Mandatory)] [string] $ContentType, [Parameter(Mandatory)] [pscredential] $Credential, [string] $Text, [ValidateSet('POST','PUT','DELETE')] [string] $Metho...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Get-TCWebLink.ps1
Get-TCWebLink.ps1
<# .SYNOPSIS Get the build type web url .DESCRIPTION Copy to clipboard the teamcity build type or configuration web url. .PARAMETER Id Mandatory, Correspond to a build configuration and autocompleted by retrieving teamcity build configuration from server.s .EXAMPLE C:\PS> G...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Get-TCProject.ps1
Get-TCProject.ps1
<# .SYNOPSIS Get the project type TeamCity object .DESCRIPTION Return the teamcity projects for the configured server. Parameters are autocompleted by retrieving project from teamcity server. .PARAMETER Project Mandatory, Also called Id, This parameter is autocomplete. .PAR...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Get-TCChange.ps1
Get-TCChange.ps1
<# .SYNOPSIS Get change for a given build. .DESCRIPTION Build are started from TeamCity or by Start-TCBuild cmdlet, then all changes (commit, checkin) can be retrieve with this cmdlet .PARAMETER Id Mandatory, If there is a Build object into the pipeline containing 2 properties : Id and...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Tag-TCBuild.ps1
Tag-TCBuild.ps1
<# .SYNOPSIS Tag a build. .DESCRIPTION Tag the build with the given Tag parameter .PARAMETER Build Mandatory, Build object in order to combine cmdlet with Pin-Build for example. .PARAMETER Tag The tag value .PARAMETER Delete Switch parameter. When delete is give...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Remove-TCProject.ps1
Remove-TCProject.ps1
<# .SYNOPSIS Remove a project. .DESCRIPTION Remove a project. CmdLet use tab expansion in order to retrieve all projects from teamcity server .PARAMETER Id The Id property of the project object from the pipeline .EXAMPLE C:\PS> Remove-TCProject Net_FSharpTemporality #> fu...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Set-TCServer.ps1
Set-TCServer.ps1
<# .SYNOPSIS Set the teamcity server root uri. .DESCRIPTION In order to avoid repetition on argument, this cmdlet set the teamcity server into a env variable called TEAMCITY .PARAMETER Uri The base Uri .EXAMPLE C:\PS> Set-TCServer http://localhost:7777/ #> function Set-TC...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Write-HostInfo.ps1
Write-HostInfo.ps1
function Write-HostInfo { [CmdletBinding(SupportsShouldProcess)] Param ( [Parameter(Mandatory, ValueFromPipeline)] [string] $Text ) Process { Write-Host -BackgroundColor DarkCyan -ForegroundColor White $Text } }
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Get-TCCredential.ps1
Get-TCCredential.ps1
function Get-TCCredential { [CmdletBinding(SupportsShouldProcess)] Param ( [Parameter(Mandatory=$false, ValueFromPipeline)] [pscredential] $Credential ) Process { if($Credential) { $global:TEAMCITY_REST = $Credential re...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Get-TCBuild.ps1
Get-TCBuild.ps1
<# .SYNOPSIS Get the build for a given build type .DESCRIPTION Get the build object when a buildtype is given into the pipeline or when the id is set to a corresponding buildtype. This parameter is autocompleted by fetching buildtype on TeamCity server. .PARAMETER Id Mandatory, Gi...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Post-ToJson.ps1
Post-ToJson.ps1
function Post-ToJson { [CmdletBinding(SupportsShouldProcess)] Param ( [Parameter(Mandatory)] [pscredential] $Credential, [Parameter(Mandatory)] $Data, [ValidateSet('POST','PUT','DELETE')] [string] $Method = 'POST', [Parameter(Mandatory...
PowerShellCorpus/Github/cboudereau_PowerShell/Teamcity/Get-TCBuildStatus.ps1
Get-TCBuildStatus.ps1
<# .SYNOPSIS Get the build status object for a given build .DESCRIPTION When a build is finished or running (any status in fact), this cmdlet return the TeamCity build state object .PARAMETER Build Mandatory, also called href, in the TeamCity semantic. The href property correspond to t...
PowerShellCorpus/Github/cboudereau_PowerShell/PSCompletion/Get-ParameterCompleter.ps1
Get-ParameterCompleter.ps1
function Get-ParameterCompleter { <# .SYNOPSIS Gets registered parameter completion scripts. .DESCRIPTION Gets registered parameter completion scripts with filtering by command and argument names. .PARAMETER CommandName Specified the name of the commands to fil...
PowerShellCorpus/Github/cboudereau_PowerShell/PSCompletion/Test-ParameterCompleter.ps1
Test-ParameterCompleter.ps1
function Test-ParameterCompleter { <# .SYNOPSIS Tests a registered parameter completion script for debugging purpose. .DESCRIPTION Tests a registered parameter completion script for debugging purpose. .PARAMETER CommandName Specified the name of the command to ...
PowerShellCorpus/Github/cboudereau_PowerShell/PSCompletion/New-CompletionResult.ps1
New-CompletionResult.ps1
function New-CompletionResult { <# .SYNOPSIS Creates a new System.Management.Automation.CompletionResult object to return from Register-ParameterCompletion script block. .DESCRIPTION Creates a new System.Management.Automation.CompletionResult object to return from ...
PowerShellCorpus/Github/cboudereau_PowerShell/PSCompletion/Register-ParameterCompleter.ps1
Register-ParameterCompleter.ps1
<# jeremie.chassaing / thinkbeforecoding 2013 The following code is based on http://www.powershellmagazine.com/2012/11/29/using-custom-argument-completers-in-powershell-3-0/ It proposes a convenient packaging to use this method easily and extensively. #> <# Create a global options t...
PowerShellCorpus/Github/majidhussain2016_helloworld/AngularJSDemos/packages/jQuery.1.9.1/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Determine the file paths $projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName $origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName if (Test-Path $projectIntelliSense...
PowerShellCorpus/Github/majidhussain2016_helloworld/AngularJSDemos/packages/jQuery.1.9.1/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # VS 11 and above supports the new intellisense JS files $vsVersion = [System.Version]::Parse($dte.Version) $supportsJsIntelliSenseFile = $vsVersion.Major -ge 11 if (-not $supportsJsIntelliSenseFile) { $displayVersio...
PowerShellCorpus/Github/majidhussain2016_helloworld/AngularJSDemos/packages/jQuery.1.9.1/Tools/common.ps1
common.ps1
function Get-Checksum($file) { $cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider" $fileInfo = Get-Item $file trap { ; continue } $stream = $fileInfo.OpenRead() if ($? -eq $false) { # Couldn't open file for reading return $null } $bytes = $...
PowerShellCorpus/Github/OPSTestPPE_E2E_Provision_2017_3_24_28_5_34/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstoragesandbox2.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1", [string]$parameters ) # Main $errorActionPreference = 'Stop' # Step-1: Download buildcore script to local echo "download build core script to local with source u...
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_NewRepo_2017_4_23_22_58_22/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstorageprod.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1", [string]$parameters ) # Main $errorActionPreference = 'Stop' # Step-1: Download buildcore script to local echo "download build core script to local with source url: ...
PowerShellCorpus/Github/rainbow82_ye-olde-promptory-o-creatures/src/packages/EntityFramework.6.1.3/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) if (Get-Module | ?{ $_.Name -eq 'EntityFramework' }) { Remove-Module EntityFramework } Import-Module (Join-Path $toolsPath EntityFramework.psd1) # SIG # Begin signature block # MIIa4AYJKoZIhvcNAQcCoIIa0TCCGs0CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/rainbow82_ye-olde-promptory-o-creatures/src/packages/EntityFramework.6.1.3/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) Initialize-EFConfiguration $project Add-EFProvider $project 'System.Data.SqlClient' 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' Write-Host Write-Host "Type 'get-help EntityFramework' to see all available Entity Framework comma...
PowerShellCorpus/Github/rainbow82_ye-olde-promptory-o-creatures/src/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/rainbow82_ye-olde-promptory-o-creatures/src/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/openqbit_ExtSystems-Weather/OpenQbit.WeatherSystem.git/packages/jQuery.1.10.2/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Determine the file paths $projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName $origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName if (Test-Path $projectIntelliSense...
PowerShellCorpus/Github/openqbit_ExtSystems-Weather/OpenQbit.WeatherSystem.git/packages/jQuery.1.10.2/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # VS 11 and above supports the new intellisense JS files $vsVersion = [System.Version]::Parse($dte.Version) $supportsJsIntelliSenseFile = $vsVersion.Major -ge 11 if (-not $supportsJsIntelliSenseFile) { $displayVersio...
PowerShellCorpus/Github/openqbit_ExtSystems-Weather/OpenQbit.WeatherSystem.git/packages/jQuery.1.10.2/Tools/common.ps1
common.ps1
function Get-Checksum($file) { $cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider" $fileInfo = Get-Item $file trap { ; continue } $stream = $fileInfo.OpenRead() if ($? -eq $false) { # Couldn't open file for reading return $null } $bytes = $...
PowerShellCorpus/Github/openqbit_ExtSystems-Weather/OpenQbit.WeatherSystem.git/packages/Modernizr.2.6.2/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Update the _references.js file Remove-Reference $scriptsFolderProjectItem $modernizrFileNameRegEx
PowerShellCorpus/Github/openqbit_ExtSystems-Weather/OpenQbit.WeatherSystem.git/packages/Modernizr.2.6.2/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) if ($scriptsFolderProjectItem -eq $null) { # No Scripts folder Write-Host "No Scripts folder found" exit } # Update the _references.js file AddOrUpdate-Reference $scriptsFolderProjectItem $modernizrFileName...