full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/dustman7g_Powershell_Snippets/RoboCopy_ExitCode_Switch.ps1 | RoboCopy_ExitCode_Switch.ps1 | #this switch will take the last exit code after a robocopy and change the last exit code for the code 1 to 7 to 0 so Jenkins Build Failure Analyzer will show as successful
Switch($LASTEXITCODE){
"0" { $LASTEXITCODE = "0"
Write-Host "No errors occurred, and no copying was done.
The source ... |
PowerShellCorpus/Github/serenetechnologies_ITextSharePdfExample/ITextSharePdfExample/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/serenetechnologies_ITextSharePdfExample/ITextSharePdfExample/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/serenetechnologies_ITextSharePdfExample/ITextSharePdfExample/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/serenetechnologies_ITextSharePdfExample/ITextSharePdfExample/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/serenetechnologies_ITextSharePdfExample/ITextSharePdfExample/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/serenetechnologies_ITextSharePdfExample/ITextSharePdfExample/packages/jQuery.UI.Combined.1.8.24/Tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Update the _references.js file
Remove-Reference $scriptsFolderProjectItem $juiFileNameRegEx |
PowerShellCorpus/Github/serenetechnologies_ITextSharePdfExample/ITextSharePdfExample/packages/jQuery.UI.Combined.1.8.24/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 $juiFileNameRegEx ... |
PowerShellCorpus/Github/serenetechnologies_ITextSharePdfExample/ITextSharePdfExample/packages/jQuery.UI.Combined.1.8.24/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/serenetechnologies_ITextSharePdfExample/ITextSharePdfExample/packages/jQuery.1.8.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/serenetechnologies_ITextSharePdfExample/ITextSharePdfExample/packages/jQuery.1.8.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/serenetechnologies_ITextSharePdfExample/ITextSharePdfExample/packages/jQuery.1.8.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/Kekic_Blog/SimpleBlog/packages/Newtonsoft.Json.7.0.1/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://www.newtonsoft.com/json/install?version=" + $package.Version
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
if ($dte2.ActiveWindo... |
PowerShellCorpus/Github/Kekic_Blog/SimpleBlog/packages/Microsoft.Bcl.Build.1.0.14/tools/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, Culture=ne... |
PowerShellCorpus/Github/Kekic_Blog/SimpleBlog/packages/Microsoft.Bcl.Build.1.0.14/tools/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
# Normalize project path before calli... |
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_Provision_2017_5_25_16_58_37/.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/white-label-development_azure-fun/Fix-It-App/C#/TakeItAllDown.ps1 | TakeItAllDown.ps1 | |
PowerShellCorpus/Github/white-label-development_azure-fun/Fix-It-App/C#/Automation/New-AzureWebsiteEnv.ps1 | New-AzureWebsiteEnv.ps1 | <#
.SYNOPSIS
Creates the environment for a Windows Azure web site, including the
databases and storage that the website requires.
.DESCRIPTION
The New-AzureWebsiteEnv.ps1 script automates the process of
creating a Windows Azure web site and its environment, including
... |
PowerShellCorpus/Github/white-label-development_azure-fun/Fix-It-App/C#/Automation/Publish-AzureWebsite.ps1 | Publish-AzureWebsite.ps1 | <#
.SYNOPSIS
Publishes a Windows Azure website project
.DESCRIPTION
The Publish-AzureWebsiteDevbox.ps1 script publishes
the project that is associated with a Windows Azure
website.
To run this script, you must have a Windows Azure
website associated with your W... |
PowerShellCorpus/Github/white-label-development_azure-fun/Fix-It-App/C#/Automation/New-AzureStorage.ps1 | New-AzureStorage.ps1 | <#
.SYNOPSIS
Creates a Windows Azure storage account.
.DESCRIPTION
The New-AzureStorage.ps1 script creates a Windows
Azure storage account (New-AzureStorageAccount)
and returns a hashtable with the storage account
name, the primary account key, and a connection
... |
PowerShellCorpus/Github/white-label-development_azure-fun/Fix-It-App/C#/Automation/New-AzureSql.ps1 | New-AzureSql.ps1 | <#
.SYNOPSIS
Creates a database server and uses it to create an application database
and a member database.
.DESCRIPTION
The New-AzureSql.ps1 script automates the process of creating databases
for a web site. The New-AzureWebSiteEnv.ps1 script calls this script.
New-Az... |
PowerShellCorpus/Github/white-label-development_azure-fun/Fix-It-App/C#/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/white-label-development_azure-fun/Fix-It-App/C#/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/white-label-development_azure-fun/Fix-It-App/C#/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/white-label-development_azure-fun/Fix-It-App/C#/packages/Microsoft.WindowsAzure.Caching.2.2.0.0/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
# Errors out and exits the rollback process
function Assert([bool]$condition, [string]$errorMessage)
{
if (-not $condition)
{
Write-Host $errorMessage
throw $errorMessage
}
}
# Gets number of elements in a list
function GetCount($li... |
PowerShellCorpus/Github/white-label-development_azure-fun/Fix-It-App/C#/packages/Microsoft.WindowsAzure.Caching.2.2.0.0/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
# Aborts execution and effects a rollback if the condition is false.
function Assert([bool]$condition, [string]$errorMessage)
{
if (-not $condition)
{
throw $errorMessage
}
}
# Gets number of elements in a list
function GetCount($list)
... |
PowerShellCorpus/Github/white-label-development_azure-fun/Fix-It-App/C#/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/white-label-development_azure-fun/Fix-It-App/C#/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/white-label-development_azure-fun/Fix-It-App/C#/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/white-label-development_azure-fun/Fix-It-App/C#/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/white-label-development_azure-fun/Fix-It-App/C#/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/white-label-development_azure-fun/Fix-It-App/C#/packages/WebGrease.1.5.2/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
# Visual Studio execution done via NuGet Package Manager
Function VSExecution($toolsPath, $project)
{
$project.DTE.ExecuteCommand("File.SaveAll", [system.string]::Empty)
# Get the msbuild version of the project and add the import
$msbuild = [Microsof... |
PowerShellCorpus/Github/white-label-development_azure-fun/Fix-It-App/C#/packages/WebGrease.1.5.2/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
# Return a relative path with reference to root as Uri object
# $rootPath - root path
# $relativePath - relative path
# $appendToRelativePath - Optional parameter. If provided will be appended to relative Path using Path.Combine()
Function GetRelativeUri($root... |
PowerShellCorpus/Github/white-label-development_azure-fun/Fix-It-App/C#/packages/Newtonsoft.Json.5.0.8/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/white-label-development_azure-fun/Fix-It-App/C#/packages/EntityFramework.6.0.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
# MIIarwYJKoZIhvcNAQcCoIIaoDCCGpwCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQ... |
PowerShellCorpus/Github/white-label-development_azure-fun/Fix-It-App/C#/packages/EntityFramework.6.0.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/LeungKaMing_myGit/框架/bootstrap/nuget/MyGet.ps1 | MyGet.ps1 | $nuget = $env:NuGet
#parse the version number out of package.json
$bsversion = ((Get-Content $env:SourcesPath\package.json) -join "`n" | ConvertFrom-Json).version
#create packages
& $nuget pack "nuget\bootstrap.nuspec" -Verbosity detailed -NonInteractive -NoPackageAnalysis -BasePath $env:SourcesPath -Version $b... |
PowerShellCorpus/Github/OPSTest_E2E_Provision_1485389141078/.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/ABartles_CSHP_230_D/Homework_1/packages/jQuery.1.9.0/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/ABartles_CSHP_230_D/Homework_1/packages/jQuery.1.9.0/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/ABartles_CSHP_230_D/Homework_1/packages/jQuery.1.9.0/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/ABartles_CSHP_230_D/Homework_1/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/ABartles_CSHP_230_D/Homework_1/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/ABartles_CSHP_230_D/HW2/packages/jQuery.1.9.0/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/ABartles_CSHP_230_D/HW2/packages/jQuery.1.9.0/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/ABartles_CSHP_230_D/HW2/packages/jQuery.1.9.0/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/ABartles_CSHP_230_D/HW2/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/ABartles_CSHP_230_D/HW2/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/ABartles_CSHP_230_D/HW2/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/ABartles_CSHP_230_D/HW2/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/ABartles_CSHP_230_D/LearningCenter/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/ABartles_CSHP_230_D/LearningCenter/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/ABartles_CSHP_230_D/LearningCenter/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/ABartles_CSHP_230_D/LearningCenter/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/ABartles_CSHP_230_D/LearningCenter/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/ABartles_CSHP_230_D/LearningCenter/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/ABartles_CSHP_230_D/LearningCenter/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/ABartles_CSHP_230_D/LearningCenter/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/ABartles_CSHP_230_D/LearningCenter/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/ABartles_CSHP_230_D/LearningCenter/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/ABartles_CSHP_230_D/LearningCenter/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/ABartles_CSHP_230_D/Homework_2/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/ABartles_CSHP_230_D/Homework_2/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/ABartles_CSHP_230_D/Homework_2/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/ABartles_CSHP_230_D/Homework_2/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/ABartles_CSHP_230_D/Homework_2/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/ABartles_CSHP_230_D/Homework_2/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/ABartles_CSHP_230_D/Homework_2/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/ABartles_CSHP_230_D/Homework_2/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/ABartles_CSHP_230_D/Homework_2/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/ABartles_CSHP_230_D/Homework_2/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/ABartles_CSHP_230_D/Homework_2/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/BenjaminBone_O365-MGMT/Globals.ps1 | Globals.ps1 | #--------------------------------------------
# Declare Global Variables and Functions here
#--------------------------------------------
#Sample function that provides the location of the script
function Get-ScriptDirectory
{
<#
.SYNOPSIS
Get-ScriptDirectory returns the proper location of the script.
... |
PowerShellCorpus/Github/helmhex_DevEnviro/cmder/vendor/conemu-maximus5/ConEmu/Addons/AnsiColors24bit.ps1 | AnsiColors24bit.ps1 | # In the current ConEmu version TrueColor is available
# only in the lower part of console buffer
$h = [Console]::WindowHeight
$w = [Console]::BufferWidth
$y = ([Console]::BufferHeight-$h)
# Clean console contents (this will clean TrueColor attributes)
Write-Host (([char]27)+"[9999S")
# Apply default powersh... |
PowerShellCorpus/Github/helmhex_DevEnviro/cmder/scripts/utils.ps1 | utils.ps1 | function Ensure-Exists ($path) {
if (-not (Test-Path $path)) {
Write-Error "Missing required $path! Ensure it is installed"
exit 1
}
return $true > $null
}
function Ensure-Executable ($command) {
try { Get-Command $command -ErrorAction Stop > $null }
catch {
If( (... |
PowerShellCorpus/Github/helmhex_DevEnviro/cmder/scripts/pack.ps1 | pack.ps1 | <#
.Synopsis
Pack cmder
.DESCRIPTION
Use this script to pack cmder into release archives
You will need to make this script executable by setting your Powershell Execution Policy to Remote signed
Then unblock the script for execution with UnblockFile .\pack.ps1
.EXAMPLE
.\pack.ps1
Cr... |
PowerShellCorpus/Github/helmhex_DevEnviro/cmder/scripts/build.ps1 | build.ps1 | <#
.Synopsis
Build Cmder
.DESCRIPTION
Use this script to build your own edition of Cmder
This script builds dependencies from current vendor/sources.json file and unpacks them.
You will need to make this script executable by setting your Powershell Execution Policy to Remote signed
Then u... |
PowerShellCorpus/Github/Microsoft_HybridRunbookWorkerConfig/HybridRunbookWorkerConfig.ps1 | HybridRunbookWorkerConfig.ps1 | configuration HybridRunbookWorkerConfig
{
Import-DscResource -ModuleName xPSDesiredStateConfiguration,HybridRunbookWorkerDsc
$OmsWorkspaceId = Get-AutomationVariable WorkspaceID
$OmsWorkspaceKey = Get-AutomationVariable WorkspaceKey
$AutomationEndpoint = Get-AutomationVariable AutomationEndpoin... |
PowerShellCorpus/Github/rstefanic_work-tools/get_latest_emails.ps1 | get_latest_emails.ps1 | $path = ".\ce programs\trial-pending"
$time = (Get-Date).AddDays(-7)
$file = Get-ChildItem $path -Filter '*.txt' |
Where-Object {$_.LastWriteTime -gt $time}
if ($file) {
notepad $file.FullName
}
else {
Write-Host "No new pending/trial files written in the last 7 days."
} |
PowerShellCorpus/Github/rstefanic_work-tools/verify.ps1 | verify.ps1 | $inputFile = Import-Csv ".\members.csv"
$errors = @{}
#$errors = New-Object System.Collections.Generic.List[System.Object]
$nameRegexp = "/^[a-z ,.'-]+$/i"
$typeRegexp = "\b(Regular|Associate|Lifetime|Transitional)\b"
$dateRegexp = "/^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$/"
function verifyCol... |
PowerShellCorpus/Github/rstefanic_work-tools/clean_desktop.ps1 | clean_desktop.ps1 | $fileSource = "$home/Desktop"
$date = Get-Date -UFormat "%m-%d-%Y"
$list = Get-ChildItem $fileSource\* -Include *.txt, *.csv, *.pdf, *.png, *.jpg, *.jpeg, *.svg, *.xls
$fileExists = Test-Path $fileSource/$date
if (!($fileExists)) {
mkdir $fileSource/$date
}
if ($list) {
$list | %{Move-Item $_ $file... |
PowerShellCorpus/Github/JohnnyBurst_BEJobReport/Get-BEJOBs.ps1 | Get-BEJOBs.ps1 | <#
.SYNOPSIS
This script will connect to Symantec BackupExec server and using PowerShell, it will collect the following information about the backup jobs:
-Job Name
-Selection Summary
-Storage
-Start Time
-Elapsed Time
-Job Status
... |
PowerShellCorpus/Github/Connexeon_dotfiles-windows/win10.kay.base.ps1 | win10.kay.base.ps1 | # Runtimes / Platforms
cint jre8
# Connexeon Tools
cinst rdm
cinst pvm
cinst slack
cinst telegram
cinst nextcloud-client
cinst toggl
# 3CX phone
Start-Process msiexec.exe -Wait -ArgumentList '/I http://downloads.3cx.com/downloads/3CXPhoneforWindows15.msi /quiet'
# Splashtop Streamer configured with dep... |
PowerShellCorpus/Github/Connexeon_dotfiles-windows/Win10.Ops.ps1 | Win10.Ops.ps1 | # Install terminal font for RDM
$FONTS = 0x14
$objShell = New-Object -ComObject Shell.Application
$objFolder = $objShell.Namespace($FONTS)
$tempFile = $env:TEMP + "\DejaVu Sans Mono for Powerline.ttf"
(new-object System.Net.WebClient).DownloadFile('http://connexeon.link/download-rdm-font', $tempFile);
$objFolder.... |
PowerShellCorpus/Github/Connexeon_dotfiles-windows/win.monitor.ps1 | win.monitor.ps1 | cinst icinga2
|
PowerShellCorpus/Github/Connexeon_dotfiles-windows/Win10.Connexeon.Base.ps1 | Win10.Connexeon.Base.ps1 | # Windows Features
cinst Microsoft-Windows-Subsystem-Linux --source windowsfeatures
cinst TelnetClient -source windowsFeatures
#cinst IIS-WebServerRole -source windowsfeatures
#cinst IIS-HttpCompressionDynamic -source windowsfeatures
#cinst IIS-ManagementScriptingTools -source windowsfeatures
#cinst IIS-WindowsAu... |
PowerShellCorpus/Github/Connexeon_dotfiles-windows/win.vmware.ps1 | win.vmware.ps1 | cinst vmware-tools
|
PowerShellCorpus/Github/Connexeon_dotfiles-windows/Win2012.Base.ps1 | Win2012.Base.ps1 | # The following settings will ask you for your windows password and then
# successfuly reboot the machine everytime it needs to. After Boxstarter is
# done autologin won't be enabled.
$Boxstarter.RebootOk=$false # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.... |
PowerShellCorpus/Github/Connexeon_dotfiles-windows/bootstrap.ps1 | bootstrap.ps1 | param (
[string]$PackageName = $(throw '-PackageName is required (at least one script URL or package name). For example "http://connexeon.link/win2012-base","icinga2"')
)
# Bootstrap Boxstarter, will install requirements too if missing
iex ((new-object net.webclient).DownloadString('https://raw.githubuserconten... |
PowerShellCorpus/Github/Connexeon_dotfiles-windows/win10.survavilkit.ps1 | win10.survavilkit.ps1 | # The following settings will ask you for your windows password and then
# successfuly reboot the machine everytime it needs to. After Boxstarter is
# done autologin won't be enabled.
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.A... |
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_Provision_2017_5_11_14_58_42/.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/Sonihal_SEPclientInfo/SEP_Statistics.ps1 | SEP_Statistics.ps1 | # variables
$ip_list = $NULL
$file_line = $NULL
$k = $NULL
$SQL = $NULL
$conn = $NULL
$cmd = $NULL
$start = $NULL
$sql_output = $NULL
$transactionComplete = $NULL
$filename = $NULL
$computer_name = $NULL
$computer_id = $NULL
$ip = $NULL
$computer_domain = $NULL
$current_group_id = $NULL
$com... |
PowerShellCorpus/Github/MrXcitement_Info-ZIP-chocolateyPackages/UnZip/tools/ChocolateyInstall.ps1 | ChocolateyInstall.ps1 | Install-ChocolateyZipPackage 'UnZip' 'ftp://ftp.info-zip.org/pub/infozip/win32/unz600xn.exe' "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
|
PowerShellCorpus/Github/MrXcitement_Info-ZIP-chocolateyPackages/Zip/tools/ChocolateyInstall.ps1 | ChocolateyInstall.ps1 | Install-ChocolateyZipPackage 'Zip' 'ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn.zip' "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
|
PowerShellCorpus/Github/Elderry_config/config.ps1 | config.ps1 | function Write-Split([string] $prefix, [string] $key, [string] $suffix) {
$total = 50
$length = $prefix.Length + $key.Length + $suffix.Length + 2
$hyphen = ($total - $length) / 2
$hyphenBefore = '-' * [math]::floor($hyphen)
$hyphenAfter = '-' * [math]::ceiling($hyphen)
Write-Host $hyphenB... |
PowerShellCorpus/Github/Elderry_config/Profile - Powershell.ps1 | Profile - Powershell.ps1 | # Custom Variables
Set-Alias vc "${env:ProgramFiles(x86)}\Microsoft VS Code\Code.exe"
Set-Alias mg '~\OneDrive\Collections\Adults\magick.ps1'
Set-Alias au '~\Projects\Personal\chocolatey-packages\update_all.ps1'
$tasks = '~\OneDrive\Collections\Tasks'
# WSL Commands
Remove-Item Alias:ls
function ls { bash -c "... |
PowerShellCorpus/Github/Elderry_config/Config - Powershell.ps1 | Config - Powershell.ps1 | $target = Join-Path $Env:UserProfile 'Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'
Copy-Item 'Profile - Powershell.ps1' $target
|
PowerShellCorpus/Github/Elderry_config/Config - Windows Console.ps1 | Config - Windows Console.ps1 | $consoleRegPath = 'HKCU:\Console'
$regPaths = @{
'cmd' = Join-Path $consoleRegPath '%SystemRoot%_System32_cmd.exe'
'posh' = Join-Path $consoleRegPath '%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe'
'posh32' = Join-Path $consoleRegPath '%SystemRoot%_SysWOW64_WindowsPowerShe... |
PowerShellCorpus/Github/Elderry_config/Config - Visual Studio Code.ps1 | Config - Visual Studio Code.ps1 | Copy-Item 'Settings - Visual Studio Code.json' (Join-Path $Env:AppData 'Code\User\settings.json')
|
PowerShellCorpus/Github/williamjacksn_chocolatey_packages/pidgin/tools/ChocolateyUninstall.ps1 | ChocolateyUninstall.ps1 | $package_name = 'Pidgin'
$installer_type = 'exe'
$silent_args = '/S'
$valid_exit_codes = @(0)
$un_folder = "Pidgin"
$un_file = "pidgin-uninst.exe"
try {
$64_bit = 0
if (Test-Path "${Env:ProgramFiles(x86)}\$un_folder\$un_file") {
$un_path = "${Env:ProgramFiles(x86)}\$un_folder\$un_file"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.