full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/rickenberg_SPSD.Extensions/15/SPSDExtensions.Samples/Scripts/Extensions/SPSD.Extensions.Client/SPSD.Extensions.Client.ps1
SPSD.Extensions.Client.ps1
############################################################################### # SharePoint Solution Deployer (SPSD) # SPSD.Extensions.Client # Wrapper for client (CSOM) PowerShell deployment extensions # Allows you currently to deploy files and workflows to SharePoint on-prem and Online # Version : 15.0...
PowerShellCorpus/Github/rickenberg_SPSD.Extensions/15/SPSDExtensions.Samples/Scripts/Extensions/Example/Example.ps1
Example.ps1
############################################################################### # SharePoint Solution Deployer (SPSD) # Version : 5.0.3.6438 # Url : http://spsd.codeplex.com # Creator : Matthias Einig # License : MS-PL # File : ExampleExtension.ps1 ############...
PowerShellCorpus/Github/hondamasakazu_webtest/WebTest/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/hondamasakazu_webtest/WebTest/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/hondamasakazu_webtest/WebTest/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/hondamasakazu_webtest/WebTest/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/hondamasakazu_webtest/WebTest/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/hondamasakazu_webtest/WebTest/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/hondamasakazu_webtest/WebTest/packages/EntityFramework.6.1.1/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/hondamasakazu_webtest/WebTest/packages/EntityFramework.6.1.1/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/hondamasakazu_webtest/WebTest/packages/Newtonsoft.Json.6.0.4/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/SteveLasker_WorksOnMyMachine/src/WorksOnMyMachine/DockerTask.ps1
DockerTask.ps1
<# .SYNOPSIS Deploys an ASP .NET Core Web Application into a docker container running in a specified Docker machine. .DESCRIPTION The following script will execute a set of Docker commands against the designated dockermachine. .PARAMETER Build Builds the containers using docker-compose build. .PARAMETER Cl...
PowerShellCorpus/Github/DanielOrneling_Azure-Automation---Create-Azure-AD-user/CreateAzureADUser.ps1
CreateAzureADUser.ps1
param ( [Parameter(Mandatory=$true)] [string] $firstname, [Parameter(Mandatory=$true)] [string] $lastname, [Parameter(Mandatory=$true)] [string] $City, [Parameter(Mandatory=$true)] [string] $Office, [Parameter(Mandatory=$true)] [string] $Country, [Parameter(Man...
PowerShellCorpus/Github/TomerAdmon_Invoke-RestMethod-2.0/Rest.ps1
Rest.ps1
Add-Type -TypeDefinition @" public enum RestMethod { GET, PUT, POST, DELETE } "@ Function ConvertTo-Json20 { [CmdletBinding()] Param( [Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)] [object]$item...
PowerShellCorpus/Github/KidFashion_Foxe-Chocolatey/foxe.install/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
$dir = $env:ChocolateyInstall Install-ChocolateyPackage 'foxe' 'exe' "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR=$dir\lib\foxe" 'http://www.firstobject.com/foxesetup242.exe'
PowerShellCorpus/Github/KidFashion_Foxe-Chocolatey/foxe.install/tools/chocolateyUninstall.ps1
chocolateyUninstall.ps1
$uninstaller = ls $env:ChocolateyInstall\lib\foxe\unins*.exe if (($uninstaller|measure-object).Count -gt 1) { $uninstaller = $uninstaller[0] } &$uninstaller /VERYSILENT /SUPPRESSMSGBOXES /NORESTART
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_Provision_2017_5_20_24_58_28/.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/mattallford_Get-NimbleVolumeUsage/Get-NimbleVolumeUsage.ps1
Get-NimbleVolumeUsage.ps1
function Get-NimbleVolumeUsage{ <# .Synopsis Gathers the compressed and uncompressed usage in GB from volumes on a Nimble Storage Array .EXAMPLE Get-NimbleVolumeUsage -NimbleGroup nimblegroup.lab.allford.id.au -Outputfile c:\scripts\Nimble_Statistics.csv .PARAMETER NimbleGroup Specify the FQDN o...
PowerShellCorpus/Github/yowko_CreateUEFIBootableUSB/UEFI_USB.ps1
UEFI_USB.ps1
# Set here the path of your ISO file $iso = 'C:\ct_windows_server_2016_x64_dvd_9327748.iso' # Set here the letter of your usb $usbdiskletter = 'F' #get disk $usb =Get-Partition| where DriveLetter -eq "$usbdiskletter"|Get-Disk # Clean ! will clear your usb!! $usb| Clear-Disk -RemoveData -Confirm:$true -Pa...
PowerShellCorpus/Github/oriaks_packer-templates/windows-81/scripts/win-updates.ps1
win-updates.ps1
param($global:RestartRequired=0, $global:MoreUpdates=0, $global:MaxCycles=5, $MaxUpdatesPerCycle=500) $Logfile = "C:\Windows\Temp\win-updates.log" function LogWrite { Param ([string]$logstring) $now = Get-Date -format s Add-Content $Logfile -value "$now $logstring" Write...
PowerShellCorpus/Github/oriaks_packer-templates/windows-81/scripts/openssh.ps1
openssh.ps1
param ( [switch]$AutoStart = $false ) Write-Output "AutoStart: $AutoStart" $is_64bit = [IntPtr]::size -eq 8 # setup openssh $ssh_download_url = "http://www.mls-software.com/files/setupssh-7.1p1-1.exe" if (!(Test-Path "C:\Program Files\OpenSSH\bin\ssh.exe")) { Write-Output "Downloading $ssh_download_...
PowerShellCorpus/Github/oriaks_packer-templates/windows-2012-r2/scripts/win-updates.ps1
win-updates.ps1
param($global:RestartRequired=0, $global:MoreUpdates=0, $global:MaxCycles=5, $MaxUpdatesPerCycle=500) $Logfile = "C:\Windows\Temp\win-updates.log" function LogWrite { Param ([string]$logstring) $now = Get-Date -format s Add-Content $Logfile -value "$now $logstring" Write...
PowerShellCorpus/Github/oriaks_packer-templates/windows-2012-r2/scripts/openssh.ps1
openssh.ps1
param ( [switch]$AutoStart = $false ) Write-Output "AutoStart: $AutoStart" $is_64bit = [IntPtr]::size -eq 8 # setup openssh $ssh_download_url = "http://www.mls-software.com/files/setupssh-7.1p1-1.exe" if (!(Test-Path "C:\Program Files\OpenSSH\bin\ssh.exe")) { Write-Output "Downloading $ssh_download_...
PowerShellCorpus/Github/oriaks_packer-templates/windows-10/scripts/win-updates.ps1
win-updates.ps1
param($global:RestartRequired=0, $global:MoreUpdates=0, $global:MaxCycles=5, $MaxUpdatesPerCycle=500) $Logfile = "C:\Windows\Temp\win-updates.log" function LogWrite { Param ([string]$logstring) $now = Get-Date -format s Add-Content $Logfile -value "$now $logstring" Write...
PowerShellCorpus/Github/oriaks_packer-templates/windows-10/scripts/fixnetwork.ps1
fixnetwork.ps1
# You cannot enable Windows PowerShell Remoting on network connections that are set to Public # Spin through all the network locations and if they are set to Public, set them to Private # using the INetwork interface: # http://msdn.microsoft.com/en-us/library/windows/desktop/aa370750(v=vs.85).aspx # For more info, ...
PowerShellCorpus/Github/oriaks_packer-templates/windows-10/scripts/openssh.ps1
openssh.ps1
param ( [switch]$AutoStart = $false ) Write-Output "AutoStart: $AutoStart" $is_64bit = [IntPtr]::size -eq 8 # setup openssh $ssh_download_url = "http://www.mls-software.com/files/setupssh-7.1p1-1.exe" if (!(Test-Path "C:\Program Files\OpenSSH\bin\ssh.exe")) { Write-Output "Downloading $ssh_download_...
PowerShellCorpus/Github/oriaks_packer-templates/windows-7/scripts/win-updates.ps1
win-updates.ps1
param($global:RestartRequired=0, $global:MoreUpdates=0, $global:MaxCycles=5, $MaxUpdatesPerCycle=500) $Logfile = "C:\Windows\Temp\win-updates.log" function LogWrite { Param ([string]$logstring) $now = Get-Date -format s Add-Content $Logfile -value "$now $logstring" Write...
PowerShellCorpus/Github/oriaks_packer-templates/windows-7/scripts/disable-updates.ps1
disable-updates.ps1
<# .SYNOPSIS Disables automatic windows updates .DESCRIPTION Disables checking for and applying Windows Updates (does not prevent updates from being applied manually or being pushed down) Run on the machine that updates need disabling on. .PARAMETER <paramName> None .EXAMPLE ./Disable-WindowsUpd...
PowerShellCorpus/Github/oriaks_packer-templates/windows-7/scripts/openssh.ps1
openssh.ps1
param ( [switch]$AutoStart = $false ) Write-Output "AutoStart: $AutoStart" $is_64bit = [IntPtr]::size -eq 8 # setup openssh $ssh_download_url = "http://www.mls-software.com/files/setupssh-7.1p1-1.exe" if (!(Test-Path "C:\Program Files\OpenSSH\bin\ssh.exe")) { Write-Output "Downloading $ssh_download_...
PowerShellCorpus/Github/jenwst_LinuxTestApplication/pstest.ps1
pstest.ps1
None
PowerShellCorpus/Github/owdd_DCCD-CodeSamples/createAMI.ps1
createAMI.ps1
Set-ExecutionPolicy unrestricted Write-Host "Setting region...." Set-DefaultAWSRegion us-east-1 Write-Host "Setting region done" $myPSKeyPair = New-EC2KeyPair -KeyName cdmeetup_auto # save key pair to disk for later use $myPSKeyPair.KeyMaterial | Out-File -Encoding ascii c:\tmp\cdmeetup_auto.pem # get...
PowerShellCorpus/Github/owdd_DCCD-CodeSamples/bootstrap.ps1
bootstrap.ps1
Write-Host "Setting EP..." Set-ExecutionPolicy unrestricted Write-Host "done" # powershell still doesn't have local user management, so you get to go old school to create local user accounts Write-Host "Create Svc user..." NET USER serviceUser "supersecretpassword" /ADD NET LOCALGROUP "Administrators" "...
PowerShellCorpus/Github/owdd_DCCD-CodeSamples/sleepInstances.ps1
sleepInstances.ps1
Set-DefaultAWSRegion us-east-1 # get all running instances that have a Parking tag w/ value Hibernate $instances = (Get-EC2Instance).RunningInstance | Where-Object {$_.Tag.Count -gt 0 -and $_.Tag.Key -eq "Parking" -and ($_.Tag.Value -eq "Sleep" -or $_.Tag.Value -eq "Hibernate" )} # stop them foreach ($instance ...
PowerShellCorpus/Github/owdd_DCCD-CodeSamples/wakeInstances.ps1
wakeInstances.ps1
Set-DefaultAWSRegion us-east-1 # get all stopped instances that have a Parking tag w/ value Sleep $instances = (Get-EC2Instance).instances | Where-Object {$_.Tag.Count -gt 0 -and $_.Tag.Key -eq "Parking" -and $_.Tag.Value -eq "Sleep" } # Start them foreach ($instance in $instances) { Start-EC2Instance $ins...
PowerShellCorpus/Github/Dahl93_Implementierungspraktikum-Gruppe-4/KMS/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/Dahl93_Implementierungspraktikum-Gruppe-4/KMS/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/Dahl93_Implementierungspraktikum-Gruppe-4/KMS/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/Dahl93_Implementierungspraktikum-Gruppe-4/KMS/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/Dahl93_Implementierungspraktikum-Gruppe-4/KMS/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/Dahl93_Implementierungspraktikum-Gruppe-4/KMS/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/Dahl93_Implementierungspraktikum-Gruppe-4/KMS/packages/Microsoft.ApplicationInsights.WindowsServer.2.2.0/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) if ([System.IO.File]::Exists($project.FullName)) { function MarkItemASCopyToOutput($item) { Try { #mark it to copy if newer $item.Properties.Item("CopyToOutputDirectory").Value = 2 } Catch { write-host $_.Exception.ToString() }...
PowerShellCorpus/Github/Dahl93_Implementierungspraktikum-Gruppe-4/KMS/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/Dahl93_Implementierungspraktikum-Gruppe-4/KMS/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/Dahl93_Implementierungspraktikum-Gruppe-4/KMS/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) if ($project.Type -eq 'Web Site') { Import-Module (Join-Path $toolsPath VS.psd1) $srcFiles = Join-Path $installPath "lib\net40\*.dll" $projectRoot = Get-ProjectRoot $project if (!$projectRoot) { return; } $destDirec...
PowerShellCorpus/Github/Dahl93_Implementierungspraktikum-Gruppe-4/KMS/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Uninstall.ps1
Uninstall.ps1
param($installPath, $toolsPath, $package, $project) if ($project.Type -eq 'Web Site') { Import-Module (Join-Path $toolsPath VS.psd1) $projectRoot = Get-ProjectRoot $project if (!$projectRoot) { return; } $binDirectory = Join-Path $projectRoot "bin" $srcDirectory = Join-Path $...
PowerShellCorpus/Github/Dahl93_Implementierungspraktikum-Gruppe-4/KMS/packages/Newtonsoft.Json.6.0.4/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/Dahl93_Implementierungspraktikum-Gruppe-4/KMS/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3/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/Dahl93_Implementierungspraktikum-Gruppe-4/KMS/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3/tools/install.ps1
install.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' $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory...
PowerShellCorpus/Github/MaoJianwei_MaoCloud_Monitor_UWP/MaoCloud/AppPackages/MaoCloud_1.0.0.0_x64_Debug_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/rgel_Azure/New-SecureCred.ps1
New-SecureCred.ps1
#requires -Version 3.0 <# .SYNOPSIS Safely save the encrypted password to a file. .DESCRIPTION The New-SecureCred.ps1 script safely saves the encrypted text (probably password) to a file. To decrypt that text you MUST meet three conditions: [1] You are logged on with the same user account used to encrypt t...
PowerShellCorpus/Github/rgel_Azure/Deploy-AzureVm.ps1
Deploy-AzureVm.ps1
#requires -Version 4.0 #requires -Modules 'AzureRM.Storage','AzureRM.Resources','AzureRM.Compute','AzureRM.Network' <# .SYNOPSIS Deploy Azure VM. .DESCRIPTION This script automate Azure VM deployment process. .PARAMETER Environment This parameter affects the choice of Json file and VM name prefix. .PARAME...
PowerShellCorpus/Github/rgel_Azure/Apply-AzVmPowerStatePolicyWf.ps1
Apply-AzVmPowerStatePolicyWf.ps1
<# .SYNOPSIS Start/Stop Azure VM in parallel on schedule based on two VM Tags (PowerOn/PowerOff). .DESCRIPTION This Azure Automation PowerShell Workflow type Runbook Start/Stop Azure VM in parallel on schedule based on two VM Tags (PowerOn/PowerOff). .NOTES Author :: Roman Gelman. Dependencies :: Azure...
PowerShellCorpus/Github/rgel_Azure/Az-Module/Write-Menu.ps1
Write-Menu.ps1
Function Write-Menu { <# .SYNOPSIS Display custom menu in the PowerShell console. .DESCRIPTION The Write-Menu cmdlet creates numbered and colored menues in the PS console window and returns the choiced entry. .PARAMETER Menu Menu entries. .PARAMETER PropertyToShow If your menu entries are objects and...
PowerShellCorpus/Github/ForNeVeR_ps-path/Add-Path.ps1
Add-Path.ps1
param( [Parameter(Mandatory = $true, Position = 0)] [string[]] $Paths, [switch] $Permanent, [switch] $CurrentUser, [switch] $Prepend ) $ErrorActionPreference = 'Stop' if (-not $Permanent -and -not $CurrentUser) { throw "Non-permanent changes are always user-specific. You should sp...
PowerShellCorpus/Github/ForNeVeR_ps-path/Add-Path.Tests.ps1
Add-Path.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") $AddPath = "$here\$sut" $GetPath = "$here/Get-Path" Describe "Add-Path" { It "does not adds items twice" { $drive = Get-PSDrive | ? { $_.Provider.Name -eq 'FileSyste...
PowerShellCorpus/Github/ForNeVeR_ps-path/Get-Path.ps1
Get-Path.ps1
$env:Path.Split(';')
PowerShellCorpus/Github/Axel-Curmi_IICT6002-A02/Axel Curmi - IICT 6002 - A02S01/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/Axel-Curmi_IICT6002-A02/Axel Curmi - IICT 6002 - A02S01/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/SherifTalaat_Apress/SimpleCalculator.ps1
SimpleCalculator.ps1
#Calculator Script Module Function Add-Numbers($x,$y) { $x + $y } Function Subtract-Numbers($x,$y) { $x - $y } New-Alias -Name an -Value Add-Numbers New-Alias -Name sn -Value Subtract-Numbers #Export modules member Export-ModuleMember -Function * -Alias *
PowerShellCorpus/Github/SherifTalaat_Apress/x1.ps1
x1.ps1
Get-Service | Out-File C:\myData\services.txt
PowerShellCorpus/Github/SherifTalaat_Apress/startupscript.ps1
startupscript.ps1
Import-Module NetTCPIP
PowerShellCorpus/Github/dcuomo_dNLB/Examples/MultiCreateNLB.ps1
MultiCreateNLB.ps1
<# $ConfigData = @{ AllNodes = @( @{ NodeName = 'DSC1601' ; Role = 'WebServer' ; HTTPName = 'WebServerHA' }, @{ NodeName = 'DSC1602' ; Role = 'WebServer' ; HTTPName = 'WebServerHA' } ); } #> $NodeData = @() 'DSC1601','DSC1602' | ForEach-Object { $NodeData += @{ NodeName = $_ ; Rol...
PowerShellCorpus/Github/dcuomo_dNLB/Examples/Tester.ps1
Tester.ps1
Configuration NLB { Import-DSCResource -ModuleName PSDesiredStateConfiguration,dNLB Node ( 'DSC1601','DSC1602' ) { WindowsFeatureSet Features { Name = 'NLB','RSAT-NLB' Ensure = 'Present' } } Node 'DSC1601' { dCluster FirstNode { ...
PowerShellCorpus/Github/dcuomo_dNLB/Examples/SimpleCreateNLB.ps1
SimpleCreateNLB.ps1
Configuration NLB { Import-DSCResource -ModuleName PSDesiredStateConfiguration,dNLB Node ( 'DSC1601','DSC1602','DSC1603','DSC1604' ) { WindowsFeatureSet Features { Name = 'NLB','RSAT-NLB' Ensure = 'Present' } } Node 'DSC1601' { dCluste...
PowerShellCorpus/Github/dcuomo_dNLB/Helpers/CreateModule.ps1
CreateModule.ps1
$ModuleName = 'dNLB' $ResourceName = 'dCluster' $ModulePath = 'C:\Program Files\WindowsPowerShell\Modules' New-xDSCResource -Name $ResourceName -Path $ModulePath -ModuleName $ModuleName -Property $( New-xDSCResourceProperty -Name HostName -Type String -Attribute Key New-xDSCResourceProperty -Nam...
PowerShellCorpus/Github/CCMH_Set-DefaultNetworkPrinter/Set-DefaultNetworkPrinter.ps1
Set-DefaultNetworkPrinter.ps1
<# Setting printers on each user to default Version 0.1, 1/19/2015 You must have this script and the Set-RegistryValueForAllUsers.psm1 together or this will not work. Run this file from admin PS on a currently logged on user that has the printer you want set default for all users. #> #imports module for getti...
PowerShellCorpus/Github/nunoms_Azure-Automation/ARM/web-app-insights-full/setup.ps1
setup.ps1
# installs the web-app-insights-full template # usage setup.ps1 [-remote] -resourceGroupName <rg_name> # param( [switch] $remote, [string] $resourceGroupName ) $baseUrl = "https://raw.githubusercontent.com/nunoms/Azure-Automation/master/ARM/web-app-insights-full" $templateUri = "$baseUrl/azureDeplo...
PowerShellCorpus/Github/nunoms_Azure-Automation/ARM/web-apps-array-parameter/setup.ps1
setup.ps1
# installs the web-apps-array-parameter template # usage setup.ps1 [-remote] -resourceGroupName <rg_name> # param( [switch] $remote, [string] $resourceGroupName ) $baseUrl = "https://raw.githubusercontent.com/nunoms/Azure-Automation/master/ARM/web-apps-array-parameter" $templateUri = "$baseUrl/azur...
PowerShellCorpus/Github/nunoms_Azure-Automation/ARM/web-app-diagnostics/setup.ps1
setup.ps1
# installs the web-app-diagnostics template # usage setup.ps1 [-remote] -resourceGroupName <rg_name> # param( [switch] $remote, [string] $resourceGroupName ) $baseUrl = "https://raw.githubusercontent.com/nunoms/Azure-Automation/master/ARM/web-app-diagnostics" $templateUri = "$baseUrl/azureDeploy.js...
PowerShellCorpus/Github/nunoms_Azure-Automation/ARM/web-app-staging-slot-continuous-deployment/setup.ps1
setup.ps1
# installs the web-app-staging-slot-continuous-deployment template # usage setup.ps1 [-remote] -resourceGroupName <rg_name> # param( [switch] $remote, [string] $resourceGroupName ) $baseUrl = "https://raw.githubusercontent.com/nunoms/Azure-Automation/master/ARM/web-app-staging-slot-continuous-deploy...
PowerShellCorpus/Github/nunoms_Azure-Automation/ARM/web-app-insights/setup.ps1
setup.ps1
# installs the web-app-insights template # usage setup.ps1 [-remote] -resourceGroupName <rg_name> # param( [switch] $remote, [string] $resourceGroupName ) $baseUrl = "https://raw.githubusercontent.com/nunoms/Azure-Automation/master/ARM/web-app-insights" $templateUri = "$baseUrl/azureDeploy.json" ...
PowerShellCorpus/Github/nunoms_Azure-Automation/ARM/web-apps-array-parameter-with-outputs/setup.ps1
setup.ps1
# installs the web-apps-array-parameter template # usage setup.ps1 [-remote] -resourceGroupName <rg_name> # param( [switch] $remote, [string] $resourceGroupName ) $baseUrl = "https://raw.githubusercontent.com/nunoms/Azure-Automation/master/ARM/web-apps-array-parameter-with-outputs" $templateUri = "...
PowerShellCorpus/Github/Romsters_newTracker/newTracker/packages/AutoMapper.3.2.1/tools/wp8/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/Romsters_newTracker/newTracker/packages/AutoMapper.3.2.1/tools/wp8/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/Romsters_newTracker/newTracker/packages/AutoMapper.3.2.1/tools/sl5/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/Romsters_newTracker/newTracker/packages/AutoMapper.3.2.1/tools/sl5/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/Romsters_newTracker/newTracker/packages/AutoMapper.3.2.1/tools/windows8/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/Romsters_newTracker/newTracker/packages/AutoMapper.3.2.1/tools/windows8/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/Romsters_newTracker/newTracker/packages/AutoMapper.3.2.1/tools/MonoTouch/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/Romsters_newTracker/newTracker/packages/AutoMapper.3.2.1/tools/MonoTouch/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/Romsters_newTracker/newTracker/packages/AutoMapper.3.2.1/tools/MonoAndroid/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/Romsters_newTracker/newTracker/packages/AutoMapper.3.2.1/tools/MonoAndroid/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/Romsters_newTracker/newTracker/packages/AutoMapper.3.2.1/tools/wpa81/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/Romsters_newTracker/newTracker/packages/AutoMapper.3.2.1/tools/wpa81/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/Romsters_newTracker/newTracker/packages/AutoMapper.3.2.1/tools/net40/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/Romsters_newTracker/newTracker/packages/AutoMapper.3.2.1/tools/net40/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/Romsters_newTracker/newTracker/packages/EntityFramework.6.1.1/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/Romsters_newTracker/newTracker/packages/EntityFramework.6.1.1/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/epamGroupB_Project/project/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/epamGroupB_Project/project/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/epamGroupB_Project/project/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/epamGroupB_Project/project/packages/EntityFramework.6.0.0/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 # MIIarwYJKoZIhvcNAQcCoIIaoDCCGpwCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/epamGroupB_Project/project/packages/EntityFramework.6.0.0/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/epamGroupB_Project/project/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/epamGroupB_Project/project/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/epamGroupB_Project/project/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/stevenrobijns_powershell-dotnet-tools/DeleteBranchesForAFC.ps1
DeleteBranchesForAFC.ps1
. .\update_references_and_packageconfigs.ps1 $featureBranchNameToDelete = "feature/ServiceBusContractsTo6.0.0-B020157" $moduleFolders = GetAfcModules -Folder $baseFolder $moduleFolders $moduleFolders = $moduleFolders[0] $moduleFolders |% { cd $_.Fullname; write-host $_.Fullname &git chec...
PowerShellCorpus/Github/stevenrobijns_powershell-dotnet-tools/manage_nuget.ps1
manage_nuget.ps1
############################################################################### # # Functions to extract information from nuget files # ############################################################################### function GetPackageFiles { param ( [string] $folder ) Get-ChildItem -Pat...
PowerShellCorpus/Github/stevenrobijns_powershell-dotnet-tools/manage_assembly.ps1
manage_assembly.ps1
############################################################################### # # Functions to extract information from a dotnet Assembly file # ############################################################################### function GetReferencedAssemblies { param ( [string] $AssemblyFile = 'C:\src\trunk...
PowerShellCorpus/Github/stevenrobijns_powershell-dotnet-tools/check_nuspec_is_valid.ps1
check_nuspec_is_valid.ps1
#not finished yet #purpose was to check if a nuspec file references certain dlls which aren't listed in it's dependencies function GetNuSpecFiles { param ( [string] $folder ) Get-ChildItem -Path $folder -Filter *.nuspec -Recurse } function GetAfcModules { param ( [string]...