full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/camalot_psievm/psievm/psievm.package/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
#requires -version 3 $name = 'psievm' function Invoke-DownloadFile { Param ( [string]$Url, [string]$File ); process { "Downloading $Url to $File" | Write-Host; $downloader = new-object System.Net.WebClient; $downloader.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredenti...
PowerShellCorpus/Github/camalot_psievm/psievm/psievm.package/tools/chocolateyUninstall.ps1
chocolateyUninstall.ps1
# I hate that these are duplicated in both the install and uninstall # but because the install is also used to invoke a non-chocolatey install # via the iex web download, it cannot import an external file easily. # So they will remain duplicated for now. function Get-DocumentsModulePath { $docsPath = (Get-Envir...
PowerShellCorpus/Github/camalot_psievm/psievm/.build/Invoke-Tests.ps1
Invoke-Tests.ps1
param ( [Parameter(Mandatory=$true)] [Version] $Version ); if($PSCommandPath -eq $null) { Write-Host "Using MyInvoction.MyCommand.Path"; $CommandRootPath = (Split-Path -Parent $MyInvocation.MyCommand.Path); } else { Write-Host "Using PSCommandPath"; $CommandRootPath = (Split-Path -Parent $PSCommandPath...
PowerShellCorpus/Github/camalot_psievm/psievm/psievm.tests/chocolateyInstall.Tests.ps1
chocolateyInstall.Tests.ps1
if($PSCommandPath -eq $null) { Write-Host "Using MyInvoction.MyCommand.Path"; $CommandRootPath = (Split-Path -Parent $MyInvocation.MyCommand.Path); } else { Write-Host "Using PSCommandPath"; $CommandRootPath = (Split-Path -Parent $PSCommandPath); } # This stops the initial invoking of Invoke-Setup; $DoSetup...
PowerShellCorpus/Github/camalot_psievm/psievm/psievm.tests/psievm.Tests.ps1
psievm.Tests.ps1
if($PSCommandPath -eq $null) { Write-Host "Using MyInvoction.MyCommand.Path"; $CommandRootPath = (Split-Path -Parent $MyInvocation.MyCommand.Path); } else { Write-Host "Using PSCommandPath"; $CommandRootPath = (Split-Path -Parent $PSCommandPath); } $module = Join-Path -Path $CommandRootPath -ChildPath "psi...
PowerShellCorpus/Github/camalot_psievm/psievm/psievm.tests/chocolateyUninstall.Tests.ps1
chocolateyUninstall.Tests.ps1
if($PSCommandPath -eq $null) { Write-Host "Using MyInvoction.MyCommand.Path"; $CommandRootPath = (Split-Path -Parent $MyInvocation.MyCommand.Path); } else { Write-Host "Using PSCommandPath"; $CommandRootPath = (Split-Path -Parent $PSCommandPath); } # This stops the initial invoking of Invoke-Uninstall; $DoU...
PowerShellCorpus/Github/iarunkumar_CARP/azure.webapp.storage.sql.provisioning/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, [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageContainerName = $ResourceGr...
PowerShellCorpus/Github/blaise594_BagofMarbles/BagOfMarbles/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/blaise594_BagofMarbles/BagOfMarbles/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/blaise594_BagofMarbles/BagOfMarbles/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/blaise594_BagofMarbles/BagOfMarbles/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/blaise594_BagofMarbles/BagOfMarbles/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/blaise594_BagofMarbles/BagOfMarbles/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/blaise594_BagofMarbles/BagOfMarbles/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/blaise594_BagofMarbles/BagOfMarbles/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/blaise594_BagofMarbles/BagOfMarbles/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/blaise594_BagofMarbles/BagOfMarbles/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/blaise594_BagofMarbles/BagOfMarbles/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/blaise594_BagofMarbles/BagOfMarbles/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/ClericMcWizzard_PS-Scripts/Importing CSV for Walker Control.ps1
Importing CSV for Walker Control.ps1
Enter-PSSession -ComputerName TMCFS1 -Credential "thomasmore\mdawe1" $FileList = Import-Csv -Path "C:\SHARES\Common\staff_shared\College\Photos\2014\Individuals\Renamed\AdminNo" $FileList
PowerShellCorpus/Github/ClericMcWizzard_PS-Scripts/Delete Old Records Walker Control.ps1
Delete Old Records Walker Control.ps1
<# ================================================ Walker control Script ================================================ ------------------------------------------------ Grabs CSV files from the Dropbox folder and gets the results from them. Then uploads those results to a MySql database. Once completed, t...
PowerShellCorpus/Github/ClericMcWizzard_PS-Scripts/Detect and Set proxy settings based on network response.ps1
Detect and Set proxy settings based on network response.ps1
#================================================================================================================ # # Check if IE is running and then set proxy settings if we are on our network, otherwise disable proxy settings if not. # #=============================================================================...
PowerShellCorpus/Github/ClericMcWizzard_PS-Scripts/Walker Control Take CSV of RFID and Bib Numbers and make Javascript Lookup Table.ps1
Walker Control Take CSV of RFID and Bib Numbers and make Javascript Lookup Table.ps1
$RFIDs = Import-Csv -Path 'C:\Users\wizzard\Desktop\Copy of Long walk bib master list 2014 - updated 10 March.csv' -Header RFID, BIB $Output = "var lookupTable = { `r`n" foreach ($RFID in $RFIDs) { $Zeros = $RFID.RFID.length $Output +="`"" while ($Zeros -lt 10) { $Output += "0" $Zer...
PowerShellCorpus/Github/ClericMcWizzard_PS-Scripts/Walker Control Import Script v2.0.ps1
Walker Control Import Script v2.0.ps1
<# ================================================ Walker control Script ================================================ ------------------------------------------------ Grabs CSV files from the Dropbox folder and gets the results from them. Then uploads those results to a MySql database. Once completed, t...
PowerShellCorpus/Github/ClericMcWizzard_PS-Scripts/Take a photo from a directory and load it as thumnail in AD.ps1
Take a photo from a directory and load it as thumnail in AD.ps1
# will need AD import-module activedirectory # set folder locations to variable, for easy changing later $newfolder = "LOCATION OF PHOTOS" $oldfolder = "LOCATION OF COMPLETED FOLDER" $logfiles = "LOCATION OF LOG FILES" #get all files in the folder and exclude subfolders $filelist = get-childitem $newfolder |...
PowerShellCorpus/Github/ClericMcWizzard_PS-Scripts/Testing Connection to Mysql.ps1
Testing Connection to Mysql.ps1
<# ==================================================================================================== Just a script to test that I can connect to our MySql server and run some arbitary sql statements ==================================================================================================== #> [voi...
PowerShellCorpus/Github/ClericMcWizzard_PS-Scripts/Reset and Lookup AD Users.ps1
Reset and Lookup AD Users.ps1
<#============================================================================================================= # # Script to do basic AD stuff like reset password and check who user is (For Verification of user identity) # ===========================================================================================...
PowerShellCorpus/Github/ClericMcWizzard_PS-Scripts/Get Automatic Services not running and start them.ps1
Get Automatic Services not running and start them.ps1
#======================================================================================= # # Get services with startup set to automatic that aren't currently running, then # start them # #======================================================================================= # Get a list of services $Servic...
PowerShellCorpus/Github/ChrisWarwick_MoonPhase/MoonPhase.ps1
MoonPhase.ps1
#region Links <# http://en.wikipedia.org/wiki/Saros_(astronomy) http://en.wikipedia.org/wiki/Year#Astronomical_years http://en.wikipedia.org/wiki/Month http://archive.org/stream/treatiseonspheri00balluoft/treatiseonspheri00balluoft_djvu.txt https://archive.org/details/treatiseonspheri00balluoft http://aa.usn...
PowerShellCorpus/Github/andrasszabo88_agilis_reporting2/Reporting/packages/EntityFramework.5.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $importedModule = Get-Module | ?{ $_.Name -eq 'EntityFramework' } if ($PSVersionTable.PSVersion -ge (New-Object Version @( 3, 0 ))) { $thisModuleManifest = 'EntityFramework.PS3.psd1' } else { $thisModuleManifest = 'EntityFramework.psd1' } $thisModule...
PowerShellCorpus/Github/andrasszabo88_agilis_reporting2/Reporting/packages/EntityFramework.5.0.0/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) function Invoke-ConnectionFactoryConfigurator($assemblyPath, $project) { $appDomain = [AppDomain]::CreateDomain( 'EntityFramework.PowerShell', $null, (New-Object System.AppDomainSetup -Property @{ ShadowCopyFiles = 'true' })) ...
PowerShellCorpus/Github/jsacapdev_net-build/deploy.ps1
deploy.ps1
# push latest docker push jsacapdev.azurecr.io/net-build:latest # push tagged docker push jsacapdev.azurecr.io/net-build:$Env:BUILD_BUILDNUMBER docker logout
PowerShellCorpus/Github/jsacapdev_net-build/build.ps1
build.ps1
# build the base image docker build -t jsacapdev.azurecr.io/net-build -f Dockerfile . # tag with the build number docker tag jsacapdev.azurecr.io/net-build jsacapdev.azurecr.io/net-build:$Env:BUILD_BUILDNUMBER
PowerShellCorpus/Github/geneseven_win10-remote-Appx/remote-Appx.ps1
remote-Appx.ps1
#Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force $AppsList = "*3dbuilder*", # 3D Builder "*windowsalarms*", # 鬧鐘與時鐘APP "*windowscalculator*", # 計算機APP "*windowscommunicationsapps*", # 日曆和信箱APP "*windowscamera*", # 相機APP "*officehub*", # Get Office "*skypeapp*"...
PowerShellCorpus/Github/stlth_Out-SpeechSynthesizer/Out-SpeechSynthesizer.ps1
Out-SpeechSynthesizer.ps1
<#PSScriptInfo .VERSION 1.0.0 .GUID 8ea83384-9a96-48b3-b29e-ae98acf8c9f9 .AUTHOR Cory Calahan .COMPANYNAME .COPYRIGHT (C) Cory Calahan. All rights reserved. .TAGS Speech .LICENSEURI .PROJECTURI https://github.com/stlth/Out-SpeechSynthesizer .ICONURI .EXTERNALMODULEDEPENDENCIES .REQUIREDSCRIPTS .EXTE...
PowerShellCorpus/Github/HostileCoding_vFRC/vFRC GUI.ps1
vFRC GUI.ps1
##################BEGIN FUNCTIONS function connectServer{ try { $connect = Connect-VIServer -Server $serverTextBox.Text -User $usernameTextBox.Text -Password $passwordTextBox.Text $buttonConnect.Enabled = $false #Disable controls once connected $serverTextBox.Enabled = $false $userna...
PowerShellCorpus/Github/OPSTest_E2E_Provision_1487224083078/.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/VladislavSushko_Epam_Pechka_Courses_2015/Epam_Courses_2015-2016_Pechka/packages/kMVC.0.6.0/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) $projectIsVB = $false try { $item = $project.ProjectItems.Item("global.asax").ProjectItems.Item("global.asax.cs") } catch { $item = $project.ProjectItems.Item("global.asax").ProjectItems.Item("global.asax.vb") $projectIsVB = $true } if ($projec...
PowerShellCorpus/Github/VladislavSushko_Epam_Pechka_Courses_2015/Epam_Courses_2015-2016_Pechka/packages/jQuery.2.1.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/VladislavSushko_Epam_Pechka_Courses_2015/Epam_Courses_2015-2016_Pechka/packages/jQuery.2.1.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/VladislavSushko_Epam_Pechka_Courses_2015/Epam_Courses_2015-2016_Pechka/packages/jQuery.2.1.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/VladislavSushko_Epam_Pechka_Courses_2015/Epam_Courses_2015-2016_Pechka/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/VladislavSushko_Epam_Pechka_Courses_2015/Epam_Courses_2015-2016_Pechka/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/VladislavSushko_Epam_Pechka_Courses_2015/Epam_Courses_2015-2016_Pechka/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/VladislavSushko_Epam_Pechka_Courses_2015/Epam_Courses_2015-2016_Pechka/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/VladislavSushko_Epam_Pechka_Courses_2015/Epam_Courses_2015-2016_Pechka/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/VladislavSushko_Epam_Pechka_Courses_2015/Epam_Courses_2015-2016_Pechka/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/VladislavSushko_Epam_Pechka_Courses_2015/Epam_Courses_2015-2016_Pechka/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/VladislavSushko_Epam_Pechka_Courses_2015/Epam_Courses_2015-2016_Pechka/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/OPS-E2E-PPE_E2E_D_NewRepo_2017_5_15_22_59_3/.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/MateuszKubuszok_CmderPackage/setup_cygwin.ps1
setup_cygwin.ps1
# Helper functions ################################################################################ Function DownloadFileIfNecessary($source, $targetDir, $targetName) { $target = $targetDir + '\' + $targetName; if (!(Test-Path $target)) { $webclient = New-Object System.Net.WebClient; if (!(Test-Path...
PowerShellCorpus/Github/MateuszKubuszok_CmderPackage/build_cmder.ps1
build_cmder.ps1
Import-Module BitsTransfer # Paths - commonly referred directories and executables ################################################################################ $CurrentDir = split-path -parent $MyInvocation.MyCommand.Definition $Tmp = "$CurrentDir\tmp" $CmderDir = "$CurrentDir\cmder" ...
PowerShellCorpus/Github/MateuszKubuszok_CmderPackage/preconfigs/cmder/set_PATH_depottools.ps1
set_PATH_depottools.ps1
$PathRegister = 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' $CurrentDir = split-path -parent $MyInvocation.MyCommand.Definition $DepotToolsDir = "$CurrentDir\cygwin\opt\depot_tools" $DepotToolsPythonDir = "$DepotToolsDir\python276_bin" $OldPATH = (Get-ItemProperty -Pa...
PowerShellCorpus/Github/rodriguesdev_JavaScript-Jquery/CasaDoCodigo.JavaScriptJquery/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/rodriguesdev_JavaScript-Jquery/CasaDoCodigo.JavaScriptJquery/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/rodriguesdev_JavaScript-Jquery/CasaDoCodigo.JavaScriptJquery/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/rodriguesdev_JavaScript-Jquery/CasaDoCodigo.JavaScriptJquery/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/rodriguesdev_JavaScript-Jquery/CasaDoCodigo.JavaScriptJquery/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/rodriguesdev_JavaScript-Jquery/CasaDoCodigo.JavaScriptJquery/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/rodriguesdev_JavaScript-Jquery/CasaDoCodigo.JavaScriptJquery/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/rodriguesdev_JavaScript-Jquery/CasaDoCodigo.JavaScriptJquery/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/rodriguesdev_JavaScript-Jquery/CasaDoCodigo.JavaScriptJquery/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/mzs-github_wsus_scripts/list-unapproved.ps1
list-unapproved.ps1
# Lists unapproved updates, one per line, as <guid>:<revisionnumber>;date;title. # Run in PowerShell as admin. # function Get-ScriptDirectory { Split-Path $script:MyInvocation.MyCommand.Path } # Die on error $ErrorActionPreference = "Stop" $scriptdir = Get-ScriptDirectory . "$scriptdir\wsus.ps1" $w...
PowerShellCorpus/Github/mzs-github_wsus_scripts/unapprove-updates.ps1
unapprove-updates.ps1
# Removes update approvals for the updates passed on standard input for the # specified WSUS computer group. This will override approvals for parent # groups for the same updates. # # .\list-approved.ps1 Some_Group > approved-updates-YYYY-MM-DD.txt # ... file contains lines like "<update guid>:<revision number>;o...
PowerShellCorpus/Github/mzs-github_wsus_scripts/wsus.ps1
wsus.ps1
[void][reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") Function Wsus-Object() { return ` [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer( $env:COMPUTERNAME, $False) } # Formats an IUpdate as <guid>:<revision number> Filter ...
PowerShellCorpus/Github/mzs-github_wsus_scripts/approve-updates.ps1
approve-updates.ps1
# Approves the updates passed on standard input for the specified WSUS # computer group. # # .\list-unapproved.ps1 > updates-YYYY-MM-DD.txt # ... file contains lines like "<update guid>:<revision number>;other info" # cat updates-YYYY-MM-DD.txt | .\approve-updates.ps1 Test_Workstations param([string]$computer_...
PowerShellCorpus/Github/mzs-github_wsus_scripts/logging.ps1
logging.ps1
# Log to wsus_scripts.log in the same directory as the script. $script_dir = Split-Path $script:MyInvocation.MyCommand.Path $LOGFILE = "$script_dir\wsus_scripts.log" Function Log([string] $log) { Add-Content $LOGFILE -value "$(Get-Date -format g) $log" } function Fatal([string] $log) { Log($log) ...
PowerShellCorpus/Github/mzs-github_wsus_scripts/list-approved.ps1
list-approved.ps1
# List the updates approved for the given group. Does not include # updates approved for parent groups. # # Run in PowerShell as admin. # .\list-approved.ps1 Test_Workstations param([string]$computer_group) function Get-ScriptDirectory { Split-Path $script:MyInvocation.MyCommand.Path } # Die on erro...
PowerShellCorpus/Github/OneLogicalMyth_DellWarranty/Functions/Get-DellWarranty.ps1
Get-DellWarranty.ps1
function Get-DellWarranty { param( #Specifies the Dell Service Tag of the device we want to check [Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true, ValueFromPipeline = $true, Position = 0)] [Alias('SerialNu...
PowerShellCorpus/Github/mhmtklck7201_deneme/MvcApplication1/packages/EntityFramework.5.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $importedModule = Get-Module | ?{ $_.Name -eq 'EntityFramework' } if ($PSVersionTable.PSVersion -ge (New-Object Version @( 3, 0 ))) { $thisModuleManifest = 'EntityFramework.PS3.psd1' } else { $thisModuleManifest = 'EntityFramework.psd1' } $thisModule...
PowerShellCorpus/Github/mhmtklck7201_deneme/MvcApplication1/packages/EntityFramework.5.0.0/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) function Invoke-ConnectionFactoryConfigurator($assemblyPath, $project) { $appDomain = [AppDomain]::CreateDomain( 'EntityFramework.PowerShell', $null, (New-Object System.AppDomainSetup -Property @{ ShadowCopyFiles = 'true' })) ...
PowerShellCorpus/Github/mhmtklck7201_deneme/MvcApplication1/packages/jQuery.1.7.1.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/mhmtklck7201_deneme/MvcApplication1/packages/jQuery.1.7.1.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 $supportsJsIntelliSenseFile = [System.Version]::Parse($dte.Version).Major -ge 11 if (-not $supportsJsIntelliSenseFile) { Write-Host "IntelliSense JS files are n...
PowerShellCorpus/Github/mhmtklck7201_deneme/MvcApplication1/packages/jQuery.1.7.1.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/timdelgado_customerexampleapi/src/CustomerExampleApi/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/pierresetteskog_AzureElasticsearchInstallation/elasticsearch-windows-install.ps1
elasticsearch-windows-install.ps1
# The MIT License (MIT) # # Copyright (c) 2015 Microsoft Azure # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, ...
PowerShellCorpus/Github/pierresetteskog_AzureElasticsearchInstallation/cleaneslog.ps1
cleaneslog.ps1
Get-ChildItem -Path "C:\elasticSearch\elasticsearch-2.4.3\logs" -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt (Get-Date).AddDays(-15)} | Remove-Item -Force $action = New-ScheduledTaskAction -Execute 'Powershell.exe' -Argument '-NoLogo -NoProfile -NonInteractive -executionpolicy bypass...
PowerShellCorpus/Github/enigma0x3_Invoke-LoginPrompt/Invoke-LoginPrompt.ps1
Invoke-LoginPrompt.ps1
<# .SYNOPSIS Standalone Powershell script that will promp the current user for a valid credentials. Author: Matt Nelson (@enigma0x3) License: BSD 3-Clause Required Dependencies: None Optional Dependencies: None .DESCRIPTION This script will pop a Windows Authentication box and ask the user for credentials. ...
PowerShellCorpus/Github/OPSTest_E2E_NewRepo_1489665935253/.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/MSUDenverSystemsEngineering_Microsoft-Teams/Deploy-Application.ps1
Deploy-Application.ps1
<# .SYNOPSIS This script performs the installation or uninstallation of an application(s). .DESCRIPTION The script is provided as a template to perform an install or uninstall of an application(s). The script either performs an "Install" deployment type or an "Uninstall" deployment type. The install deploymen...
PowerShellCorpus/Github/MSUDenverSystemsEngineering_Microsoft-Teams/AppDeployToolkit/AppDeployToolkitExtensions.ps1
AppDeployToolkitExtensions.ps1
<# .SYNOPSIS This script is a template that allows you to extend the toolkit with your own custom functions. .DESCRIPTION The script is automatically dot-sourced by the AppDeployToolkitMain.ps1 script. .NOTES Toolkit Exit Code Ranges: 60000 - 68999: Reserved for built-in exit codes in Deploy-Applicatio...
PowerShellCorpus/Github/MSUDenverSystemsEngineering_Microsoft-Teams/AppDeployToolkit/AppDeployToolkitMain.ps1
AppDeployToolkitMain.ps1
<# .SYNOPSIS This script contains the functions and logic engine for the Deploy-Application.ps1 script. .DESCRIPTION The script can be called directly to dot-source the toolkit functions for testing, but it is usually called by the Deploy-Application.ps1 script. The script can usually be updated to the latest versio...
PowerShellCorpus/Github/MSUDenverSystemsEngineering_Microsoft-Teams/AppDeployToolkit/AppDeployToolkitHelp.ps1
AppDeployToolkitHelp.ps1
<# .SYNOPSIS Displays a graphical console to browse the help for the App Deployment Toolkit functions .DESCRIPTION Displays a graphical console to browse the help for the App Deployment Toolkit functions .EXAMPLE AppDeployToolkitHelp.ps1 .NOTES .LINK http://psappdeploytoolkit.com #> ##*================...
PowerShellCorpus/Github/MSUDenverSystemsEngineering_Microsoft-Teams/Tests/PSScriptAnalyzer.tests.ps1
PSScriptAnalyzer.tests.ps1
Describe 'Testing against PSScriptAnalyzer rules' { Context 'PSScriptAnalyzer Standard Rules' { $analysis = Invoke-ScriptAnalyzer -Path 'Deploy-Application.ps1' $scriptAnalyzerRules = Get-ScriptAnalyzerRule forEach ($rule in $scriptAnalyzerRules) { It "Should pass $rule" { If ($analysis.RuleName -co...
PowerShellCorpus/Github/Jacke112_WebGames/Breakout/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/Jacke112_WebGames/Breakout/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/Jacke112_WebGames/Breakout/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/wali007hamza_Tools/PowerShellEnvironmentSetter.ps1
PowerShellEnvironmentSetter.ps1
$currentDir = (Get-Item -Path ".\" -Verbose).FullName #$regex = [regex]".*Repo." #$directory = $regex.Match($currentDir).Captures[0].Value #$gitRepo = (Get-ChildItem $directory *.git* -Recurse -Directory -Hidden -Verbose).FullName #$dir = $gitRepo.Substring(0, $gitRepo.Length-4) #$cmdPath = $dir + "tools\path1st...
PowerShellCorpus/Github/wali007hamza_Tools/Invoker.ps1
Invoker.ps1
$currentDir = (Get-Item -Path ".\" -Verbose).FullName $regex = [regex]".*Repo." $directory = $regex.Match($currentDir).Captures[0].Value $gitRepo = (Get-ChildItem $directory *.git* -Recurse -Directory -Hidden -Verbose).FullName $dir = $gitRepo.Substring(0, $gitRepo.Length-4) $cmdPath = $dir + "tools\path1st\myenv....
PowerShellCorpus/Github/wali007hamza_Tools/AliasSetter.ps1
AliasSetter.ps1
# EnvironmentVariables $env:PATH += ";C:\MyRepo\Tools" #Development Aliases function OpenOls{ devenv $Env:srcroot\ols\ols.sln } set-alias dev_ols OpenOls function OpenSvcDef{ devenv $Env:srcroot\osisvcdef\ols\src\servicedefinitions\ols\ols.sln } set-alias dev_svcdef OpenSvcDef function SvcD...
PowerShellCorpus/Github/tmandali_pstest/PsTest/Script.ps1
Script.ps1
# # Script.ps1 #
PowerShellCorpus/Github/imcuteani_Azure-HDInsight/HDInsightProvision.ps1
HDInsightProvision.ps1
# # HDInsightProvisionScript.ps1 # # Create an Azure storage account $storageAccountName = "<StorageAcccountName>" $location = "<Microsoft data center>" # For example, "West US" New-AzureStorageAccount -StorageAccountName $storageAccountName -Location $location # List storage accounts for the curre...
PowerShellCorpus/Github/imcuteani_Azure-HDInsight/Add-AzureStorageContext.ps1
Add-AzureStorageContext.ps1
#List storage accounts for the current subscription Get-AzureStorageAccount #List the keys for a storage account Get-AzureStorageKey -StorageAccountName "max451demo" $storageAccountName = "max451demo" $storageAccountKey = Get-AzureStorageKey $storageAccountName | %{$_.Primary} $containerName = "max451blob...
PowerShellCorpus/Github/imcuteani_Azure-HDInsight/Load-DataIntoHiveTable.ps1
Load-DataIntoHiveTable.ps1
# Provide Azure subscription name, and the Azure Storage account and container that is used for the default HDInsight file system. $subscriptionName = "Pay-As-You-Go" $storageAccountName = "max451demo" $containerName = "max451blob3e" # Provide HDInsight cluster name Where you want to run the Hive job $clusterNam...
PowerShellCorpus/Github/imcuteani_Azure-HDInsight/Add-AzureStorageAccount.ps1
Add-AzureStorageAccount.ps1
# Create an Azure storage account $storageAccountName = "max451demo" $location = "West US" New-AzureStorageAccount -StorageAccountName $storageAccountName -Location $location
PowerShellCorpus/Github/imcuteani_Azure-HDInsight/Add-AzureHDInsightCluster.ps1
Add-AzureHDInsightCluster.ps1
# To Provision a cluster $storageAccountName = "max451demo" $containerName = "max451blob3e" $clusterName = "max451" $location = "West US" $clusterNodes = 2 #Get the storage account key $storageAccountKey = Get-AzureStorageKey $storageAccountName | %{$_.Primary} #Create a new HDInsight cluster New-AzureHD...
PowerShellCorpus/Github/imcuteani_Azure-HDInsight/Copy-AzureBlobData.ps1
Copy-AzureBlobData.ps1
Use-AzureHDInsightCluster max451 $subscriptionName = "Pay-As-You-Go" $storageAccountName = "max451demo" $containerName = "max451blob3e" $fileName ="E:\HDInsight\thirdeye\demo\max451_details_feb2014week4.txt" $blobName = "demo\max451_details_feb2014week4.txt" # Get the storage account key Select-AzureSubsc...
PowerShellCorpus/Github/imcuteani_Azure-HDInsight/Add-HiveTable.ps1
Add-HiveTable.ps1
Add-AzureAccount '<azureaccountname>' # Provide Azure subscription name, and the Azure Storage account and container that is used for the default HDInsight file system. $subscriptionName = "<SubscriptionName>" $storageAccountName = "<AzureStorageAccountName>" $containerName = "<AzureStorageContainerName>" # Pr...
PowerShellCorpus/Github/imcuteani_Azure-HDInsight/Load-ScriptHiveTable.ps1
Load-ScriptHiveTable.ps1
Use-AzureHDInsightCluster max451 Invoke-Hive "select to_date(date_time), campaign, channel, count(*) from max451_data group by to_date(date_time), campaign, channel;" Invoke-Hive "select to_date(date_time), geo_city, geo_zip, count(*) from max451_data group by to_date(date_time), geo_city, geo_zip;"
PowerShellCorpus/Github/imcuteani_Azure-HDInsight/Upload-DataToBlobStorage.ps1
Upload-DataToBlobStorage.ps1
$subscriptionName = "<AzureSubscriptionName>" $clusterName = "<HDInsightClusterName>" $sqlDatabaseServerName = "<SQLDatabaseServerName>" $sqlDatabaseUserName = "<SQLDatabaseDatabaseName>" $sqlDatabasePassword = "<SQLDatabasePassword>" $sqlDatabaseDatabaseName = "<SQLDatabaseDatabaseName>" $tableName = "<SQLData...