full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/Erreinion_PowerShell/ComputerRename.ps1 | ComputerRename.ps1 | #############
## author: Jordan Schroeder
## date: May 20, 2010
## sources: http://theessentialexchange.com/blogs/michael/archive/2008/02/04/Rename-Reboot-with-Powershell.aspx
#############
$computer = Read-Host "What is the current name of the computer to be renamed?"
$newname = Read-Host "What is the new nam... |
PowerShellCorpus/Github/Erreinion_PowerShell/UnlockUser.ps1 | UnlockUser.ps1 | # Mar 1, 2010
# Jordan Schroeder
#
# enables and unlocks the user entered
# Check for arguments, grab username
if ($args[0]) { $samaccountName = $args[0] }
else {Write-Host "Must supply a valid username" }
# Determine if user exists
if (Get-ADUser $samaccountName){
Unlock-ADAccount $samaccountName
Enabl... |
PowerShellCorpus/Github/Erreinion_PowerShell/GetServiceTag.ps1 | GetServiceTag.ps1 | # Feb 15, 2010
# http://gallery.technet.microsoft.com/ScriptCenter/en-us/ee7116ea-b0f2-42ce-9fe8-af9ff727a784
# Jordan Schroeder
#
# lookup a single computer, or search the entire AD
#
Add-PSSnapin Quest.ActiveRoles* -erroraction silentlycontinue
$server = $args[0]
$tempfile="c:\temp\foo.txt"
if ($server... |
PowerShellCorpus/Github/Erreinion_PowerShell/manager-review_generic.ps1 | manager-review_generic.ps1 | # created Jan 10, 2013
# author: Jordan Schroeder
#
# purpose: email managers with their department's user list for review
Import-Module ActiveDirectory
$depts = @{
'Claims' = 'manager@example.com';
'Underwriting' = 'manager@example.com';
'BSS' = 'manager@example.com... |
PowerShellCorpus/Github/matt-catellier_ParkingApp/prototypes/v1/VisualStudio/WebApplication1/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/matt-catellier_ParkingApp/prototypes/v1/VisualStudio/WebApplication1/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/matt-catellier_ParkingApp/prototypes/v1/VisualStudio/WebApplication1/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/matt-catellier_ParkingApp/prototypes/v1/VisualStudio/WebApplication1/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/matt-catellier_ParkingApp/prototypes/v1/VisualStudio/WebApplication1/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/matt-catellier_ParkingApp/prototypes/v1/VisualStudio/WebApplication1/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/matt-catellier_ParkingApp/prototypes/v1/VisualStudio/WebApplication1/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/matt-catellier_ParkingApp/prototypes/v1/VisualStudio/WebApplication1/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/hoamaid_Ruby-Training/VerifyProposedOrderRequestFormat.ps1 | VerifyProposedOrderRequestFormat.ps1 | [cmdletbinding()]
Param(
[parameter(Mandatory=$true)]
[alias("j")]
[string]$ProposedOrderRequestBody
)
function Add-Error([string]$message) {
Write-Host $message -ForegroundColor Red
$global:Formaterror = $true
}
function Add-Warning([string]$msg){
Write-Host $msg -Foreground Ye... |
PowerShellCorpus/Github/liatbk_AskBalubiChanges/AskBalubi/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/liatbk_AskBalubiChanges/AskBalubi/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/liatbk_AskBalubiChanges/AskBalubi/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/liatbk_AskBalubiChanges/AskBalubi/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/liatbk_AskBalubiChanges/AskBalubi/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/liatbk_AskBalubiChanges/AskBalubi/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/liatbk_AskBalubiChanges/AskBalubi/packages/Microsoft.ApplicationInsights.WindowsServer.2.1.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/liatbk_AskBalubiChanges/AskBalubi/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/liatbk_AskBalubiChanges/AskBalubi/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/liatbk_AskBalubiChanges/AskBalubi/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/liatbk_AskBalubiChanges/AskBalubi/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/liatbk_AskBalubiChanges/AskBalubi/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/wolfpack2000_thebrickyard/ImportMachineCM.ps1 | ImportMachineCM.ps1 | param(
[string] $username,
[string] $password,
[string] $siteserver,
[string] $machinename,
[string] $macaddress
)
#You will need the credential object if the runbook service account doesnt have rights. Username and passwor are not used unless creds are needed.
#$cred = New-Object System.Management.Automation... |
PowerShellCorpus/Github/ben-houghton_threetiertemplate/Deploy-ReferenceArchitecture.ps1 | Deploy-ReferenceArchitecture.ps1 | #
# Deploy_ReferenceArchitecture.ps1
#
param(
[Parameter(Mandatory=$true)]
$SubscriptionId,
[Parameter(Mandatory=$true)]
$Location,
[Parameter(Mandatory=$false)]
[ValidateSet("DeployAll", "Infrastructure", "ADDS", "Operational")]
$Mode = "DeployAll"
)
$ErrorActionPreference = "Stop"
... |
PowerShellCorpus/Github/ben-houghton_threetiertemplate/bin/Debug/staging/uk-official-azure-three-tier-win/Deploy-ReferenceArchitecture.ps1 | Deploy-ReferenceArchitecture.ps1 | #
# Deploy_ReferenceArchitecture.ps1
#
param(
[Parameter(Mandatory=$true)]
$SubscriptionId,
[Parameter(Mandatory=$true)]
$Location,
[Parameter(Mandatory=$false)]
[ValidateSet("Prepare", "Onpremise", "Infrastructure", "CreateVpn", "AzureADDS", "WebTier", "Workload", "PublicDmz", "PrivateDmz")]... |
PowerShellCorpus/Github/ben-houghton_threetiertemplate/extensions/enable-windows-auth.ps1 | enable-windows-auth.ps1 | Set-WebConfigurationProperty -Filter "/system.webServer/security/authentication/windowsAuthentication" -Name Enabled -Value True -PSPath "IIS:\Sites\$SiteName\$AppName"
Set-WebConfigurationProperty -Filter "/system.webServer/security/authentication/anonymousAuthentication" -Name Enabled -Value False -PSPath "IIS:\Si... |
PowerShellCorpus/Github/ben-houghton_threetiertemplate/extensions/adds.ps1 | adds.ps1 | [CmdletBinding()]
Param(
[Parameter(Mandatory=$True)]
[string]$AdminUser,
[Parameter(Mandatory=$True)]
[string]$AdminPassword,
[Parameter(Mandatory=$True)]
[string]$SafeModePassword,
[Parameter(Mandatory=$True)]
[string]$DomainName,
[Parameter(Mandatory=$True)]
[string]$SiteName
... |
PowerShellCorpus/Github/ben-houghton_threetiertemplate/extensions/adds-forest.ps1 | adds-forest.ps1 | [CmdletBinding()]
Param(
[string]$SafeModePassword = "SafeModeP@ssw0rd",
[string]$DomainName = "contoso.com",
[string]$DomainNetbiosName = "CONTOSO"
)
$ErrorActionPreference = "Stop"
Initialize-Disk -Number 2 -PartitionStyle GPT
New-Partition -UseMaximumSize -DriveLetter F -DiskNumber 2
Format-Volume -D... |
PowerShellCorpus/Github/donrsh001_GitHub/Get-Uptime.ps1 | Get-Uptime.ps1 |
<#
.NOTES
===========================================================================
Created on: 2016-01-11 08:28
Created by: Arash Nabi
Mail: arash@nabi.nu
===========================================================================
.SYNOPSIS
A brief description of the Get-UpTim... |
PowerShellCorpus/Github/thomasjo_appveyor-miktex/prepare.ps1 | prepare.ps1 | $RepoDir = "$PSScriptRoot\miktex-repo"
$TargetDir = "$PSScriptRoot\miktex-portable"
Remove-Item -Path $TargetDir -ErrorAction SilentlyContinue -WarningAction SilentlyContinue -Recurse -Force
$Date = ((Get-Date).ToUniversalTime()).ToString("ddd MMM d HH:mm:ss yyyy UTC")
$PosixTargetDir = $TargetDir -replace "\\",... |
PowerShellCorpus/Github/thomasjo_appveyor-miktex/download.ps1 | download.ps1 | $TickMark = [Char]0x2713
function Expand-ZipFile($FilePath, $DestinationPath) {
New-Item -ItemType Directory -Path $DestinationPath -WarningAction SilentlyContinue -Force | Out-Null
$Shell = New-Object -ComObject Shell.Application
$ZipFile = $Shell.Namespace($FilePath)
# vOption flags: http://msdn.mi... |
PowerShellCorpus/Github/WassinkJ_TestProject/WebApplication1/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/WassinkJ_TestProject/WebApplication1/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/TheGreatV_MVC/Project/Forum/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/TheGreatV_MVC/Project/Forum/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/TheGreatV_MVC/Project/Forum/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/TheGreatV_MVC/Project/Forum/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/TheGreatV_MVC/Project/Forum/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/TheGreatV_MVC/Project/Forum/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/TheGreatV_MVC/Project/Forum/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/TheGreatV_MVC/Project/Forum/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/TheGreatV_MVC/Project/Forum/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/TheGreatV_MVC/Project/Forum/packages/EntityFramework.6.1.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/TheGreatV_MVC/Project/Forum/packages/EntityFramework.6.1.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/TheGreatV_MVC/Project/Forum/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/TheGreatV_MVC/Project/Forum/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/TheGreatV_MVC/Project/Forum/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/jeromejeromejerome_PSTestVeyor/RunPester.ps1 | RunPester.ps1 | #
# execute Pester tests
#
#Import-Module "$PSScriptRoot\Pester\Pester.psm1"
Invoke-Pester -CodeCoverage *.ps1 -Path "$PSScriptRoot\PSExample" -OutputFormat NUnitXml -OutputFile "$PSScriptRoot\TestResult.xml" -PassThru
|
PowerShellCorpus/Github/jeromejeromejerome_PSTestVeyor/PSExample/Location.Tests.ps1 | Location.Tests.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
. "$here\$sut"
Describe -Tags "Example" "Add-Numbers" {
context "regular" {
It "Check City" {
GetCity | Should Be "San Diego (Mira Mesa)"
}
}
conte... |
PowerShellCorpus/Github/jeromejeromejerome_PSTestVeyor/PSExample/Location.ps1 | Location.ps1 | function GetCity() {
$address = Invoke-RestMethod -Uri http://ip-api.com/json
return $address.city;
}
|
PowerShellCorpus/Github/minr-houki_PowerShell/tests/test_poshPHP/test_poshPHP.ps1 | test_poshPHP.ps1 | ##################################################################
#test for 'poshPHP.ps1'
##################################################################
#region initialize
param(
$self = $script:myInvocation.MyCommand.path
)
$parent = (split-path $self -parent)
$helperDir = (join-path $parent '..... |
PowerShellCorpus/Github/minr-houki_PowerShell/tests/test_scriptHelper/test_scriptHelper.ps1 | test_scriptHelper.ps1 | ##################################################################
#test for 'scriptHelper.ps1'
##################################################################
#region initialize
param(
$self = $script:myInvocation.MyCommand.path
)
$parent = split-path $self -parent
$targetDir = (join-path $parent '..\..... |
PowerShellCorpus/Github/minr-houki_PowerShell/tests/test_testHelper/test_testHelper.ps1 | test_testHelper.ps1 | ##################################################################
#test for 'testHelper.ps1'
##################################################################
#region initialize
param(
$self = $script:myInvocation.MyCommand.path
)
$parent = split-path $self -parent
$targetDir = (join-path $parent '..\..\s... |
PowerShellCorpus/Github/minr-houki_PowerShell/tests/test_configHelper/test_configHelper.ps1 | test_configHelper.ps1 | ##################################################################
#test for 'configHelper.ps1'
##################################################################
#region initialize
param(
$self = $script:myInvocation.MyCommand.path
)
$parent = (split-path $self -parent)
$targetDir = (join-path $paren... |
PowerShellCorpus/Github/minr-houki_PowerShell/scripts/php/poshPHP.ps1 | poshPHP.ps1 | filter InvokePHPScript{
$encoding = [System.Text.Encoding]::GetEncoding("shift_jis")
$tempfile = [System.IO.Path]::GetTempFileName()
[System.IO.File]::WriteAllText($tempfile,$_,$encoding)
php -f $tempfile
del $tempfile
}
# file
function readfile($filename){
@"
<?php
readfile('$filenam... |
PowerShellCorpus/Github/minr-houki_PowerShell/scripts/helpers/scriptHelper.ps1 | scriptHelper.ps1 | filter invoke{
Invoke-Expression("&{$_} $args")
}
function enc{
param(
# In use, please add validate set as necessary.
[ValidateSet('utf-8','shift-jis','euc-jp')]
$encoding = 'utf-8'
)
[System.Text.Encoding]::GetEncoding($encoding)
}
# refer to PHP
function read_file{
param(
... |
PowerShellCorpus/Github/minr-houki_PowerShell/scripts/helpers/testHelper.ps1 | testHelper.ps1 | # refer to Pester
function should_be($expected){
$actual = "$input"
if($actual -eq "$expected"){
Write-Host ('TRUE' ) -BackgroundColor DarkGreen
$true
} else {
Write-Host ('FALSE' ) -BackgroundColor DarkRed
Write-Host (' [expected] ' + $expected)... |
PowerShellCorpus/Github/minr-houki_PowerShell/scripts/helpers/configHelper.ps1 | configHelper.ps1 | # refer to Ansible
# string -> script block
filter file:{
param(
[ValidateSet('directory','file','absent')]
$state,
[switch]$recurse # state=directory only
)
$path = $_
switch($state){
'directory'{
if(Test-Path $path){
if((Get-I... |
PowerShellCorpus/Github/hello7s_MVC/DoubleR_Tune/DoubleR/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/hello7s_MVC/DoubleR_Tune/DoubleR/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/hello7s_MVC/DoubleR_Tune/DoubleR/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/hello7s_MVC/DoubleR_Tune/DoubleR/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/hello7s_MVC/DoubleR_Tune/DoubleR/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/hello7s_MVC/DoubleR_Tune/DoubleR/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/hello7s_MVC/DoubleR_Tune/DoubleR/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/hello7s_MVC/DoubleR_Tune/DoubleR/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/hello7s_MVC/DoubleR_Tune/DoubleR/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/hello7s_MVC/DoubleR_Tune/DoubleR/PublishScripts/Publish-WebApplicationWebsite.ps1 | Publish-WebApplicationWebsite.ps1 | #Requires -Version 3.0
<#
.SYNOPSIS
Creates and deploys a Microsoft Azure Website for a Visual Studio web project.
For more detailed documentation go to: http://go.microsoft.com/fwlink/?LinkID=394471
.EXAMPLE
PS C:\> .\Publish-WebApplicationWebSite.ps1 `
-Configuration .\Configurations\WebApplication1-WAWS-... |
PowerShellCorpus/Github/tliursc_Ansible/WindowsConfigScript/ConfigureRemotingForAnsible.ps1 | ConfigureRemotingForAnsible.ps1 | # Configure a Windows host for remote management with Ansible
# -----------------------------------------------------------
#
# This script checks the current WinRM/PSRemoting configuration and makes the
# necessary changes to allow Ansible to connect, authenticate and execute
# PowerShell commands.
#
# Set $Ve... |
PowerShellCorpus/Github/tliursc_Ansible/WindowsConfigScript/upgrade_to_ps3.ps1 | upgrade_to_ps3.ps1 |
# Powershell script to upgrade a PowerShell 2.0 system to PowerShell 3.0
# based on http://occasionalutility.blogspot.com/2013/11/everyday-powershell-part-7-powershell.html
#
# some Ansible modules that may use Powershell 3 features, so systems may need
# to be upgraded. This may be used by a sample playbook. R... |
PowerShellCorpus/Github/jmalczak_internal.powershell/Autostart.ps1 | Autostart.ps1 | # Variables
$Global:codePath = $PSScriptRoot;
$codePath = $PSScriptRoot;
$rootPath = "$codePath\..\"
$Global:isPowershell = "true"
Import-Module "$codePath\MalczuModule.psm1" -Global -DisableNameChecking
$currentHost = Get-Host
if($currentHost.Name -eq "ConsoleHost")
{
Import-Module PSReadLine
}
... |
PowerShellCorpus/Github/jmalczak_internal.powershell/Aliases/Tools.ps1 | Tools.ps1 | set-alias 7z "C:\Program Files\7-Zip\7z.exe"
set-alias g git
set-alias mb "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"
|
PowerShellCorpus/Github/jmalczak_internal.powershell/Functions/Git.ps1 | Git.ps1 | function gitp() {
git pull
}
function gitpu() {
git push
}
function gitcm($message) {
git commit -m '$message';
}
function tor($cmd){
& "C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe" /command:$cmd /path:.
}
function setup-git($username, $email){
git config --global us... |
PowerShellCorpus/Github/jmalczak_internal.powershell/Functions/Tools.ps1 | Tools.ps1 | $ErrorActionPreference = "Stop";
function malczu-help() {
Get-Command -Module MalczuModule;
}
function rmr {
rm $args -Recurse -Force
}
function rsql {
Start-Service "MSSQLServer"
}
function wifi {
netsh wlan start hostednetwork
}
function grepft($wildcard, $path, $fileTypes) {
... |
PowerShellCorpus/Github/jmalczak_internal.powershell/Functions/Prompt.ps1 | Prompt.ps1 | function global:prompt {
$realLASTEXITCODE = $LASTEXITCODE
if ($env:ConEmuBaseDir -ne $null) {
& ConEmuC.exe -StoreCWD "$dir"
}
Write-Host(&date -Format "dd MMMM yyyy hh:mm:ss") -nonewline -ForegroundColor Magenta
Write-Host(" :: ") -nonewline
Write-Host(&hostname) -ForegroundCo... |
PowerShellCorpus/Github/jmalczak_internal.powershell/Functions/Chilli.ps1 | Chilli.ps1 | $Global:CHILLI = "$CODE\Chilli";
function chilli() {
cd $CHILLI;
} |
PowerShellCorpus/Github/jmalczak_internal.powershell/Functions/Vim.ps1 | Vim.ps1 | $Global:V = "$rootPath\..\internal\internal.vim";
function v() {
cd $V;
}
function vimgc() {
if(test-path $V\_vimrc) {
rm $V\_vimrc
}
if(test-path $V\_vsvimrc) {
rm $V\_vsvimrc
}
cp $V\base.vim $V\_vimrc
cp $V\base.vim $V\_vsvimrc
Get-ChildItem $V... |
PowerShellCorpus/Github/jmalczak_internal.powershell/Functions/Katon.ps1 | Katon.ps1 | $Global:KATON = "$CODE\katon";
function katon() {
cd $KATON;
} |
PowerShellCorpus/Github/jmalczak_internal.powershell/Functions/Paths.ps1 | Paths.ps1 | function home() {
cd $HOME;
}
$Global:DOWNLOADS = "$HOME\Downloads";
function downloads() {
cd $DOWNLOADS;
}
$Global:DESKTOP = "$HOME\Desktop";
function desktop() {
cd $DESKTOP;
}
$Global:CODE = "$rootPath\..";
function co() {
cd $CODE;
}
function cd($path) {
pushd;
... |
PowerShellCorpus/Github/aaronsb_posh-thycotic/New-SWRandomPassword.ps1 | New-SWRandomPassword.ps1 | function New-SWRandomPassword {
<#
.Synopsis
Generates one or more complex passwords designed to fulfill the requirements for Active Directory
.DESCRIPTION
Generates one or more complex passwords designed to fulfill the requirements for Active Directory
.EXAMPLE
New-SWRandomP... |
PowerShellCorpus/Github/aaronsb_posh-thycotic/new-passphrase.ps1 | new-passphrase.ps1 | function New-PassPhrase
{param([switch]$IncludeSecureString)
$rand = new-object System.Random
$conjunction = "the","my","we","our","and","but","+"
$punctuation = "~","!","@","#","%","*","&"
$words = import-csv $env:toolBoxXML + "\etc\dict.csv"
$word1 = (Get-Culture).TextInfo.ToTitleCase(($words[$rand.Next(0... |
PowerShellCorpus/Github/aaronsb_posh-thycotic/new-selectbox.ps1 | new-selectbox.ps1 | function New-SelectBox
{Param($BoxText,[array]$List,[int]$yscale=0,[switch]$MultiSelect)
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$form = New-Object System.Windows.Forms.Form
$form.Text = $BoxText
$form.Size = New-Object System.Drawing.Size(300,(200+$yscale))
... |
PowerShellCorpus/Github/aaronsb_posh-thycotic/Choose-ADOrgUnit.ps1 | Choose-ADOrgUnit.ps1 | function Choose-ADOrganizationalUnit
{
#========================================================================
# Code Generated By: SAPIEN Technologies, Inc., PowerShell Studio 2012 v3.1.24
# Generated On: 29-10-2013 13:45
# Generated By: Michaja van der Zouwen
# Organization: -
#======... |
PowerShellCorpus/Github/aaronsb_posh-thycotic/secretserver/thycoticapi.ps1 | thycoticapi.ps1 | #Powershell service integration for thycotic secret server
#https://secretserver.domain.com/SecretServer/webservices/sswebservice.asmx
# add an error handler.
function Remove-ThycoticAPI
{
Remove-Variable ThycoticService -scope global
Remove-Variable ThycoticConfig -scope global
}
function Init-Thycotic... |
PowerShellCorpus/Github/aaronsb_posh-thycotic/secretserver/guibits.ps1 | guibits.ps1 | function Select-ThyTemplate
{
$List = Get-ThyTemplates | Sort-Object -Property ID | %{$_.ID.ToString() + ":" + $_.Name.ToString()}
$TemplateID = (New-SelectBox -BoxText "Thycotic Secret Template List" -List $List -yscale ($list.count * 10) | %{$_.split(":")})
if (!$TemplateID)
{
write-error "No template sel... |
PowerShellCorpus/Github/aaronsb_posh-thycotic/toolboxcore/New-SymLink.ps1 | New-SymLink.ps1 | Function New-SymLink {
<#
.SYNOPSIS
Creates a Symbolic link to a file or directory
.DESCRIPTION
Creates a Symbolic link to a file or directory as an alternative to mklink.exe
.PARAMETER Path
Name of the path that you will reference with a symbol... |
PowerShellCorpus/Github/aaronsb_posh-thycotic/toolboxcore/Get-ToolBoxXMLConfigs.ps1 | Get-ToolBoxXMLConfigs.ps1 | function Get-ToolboxXMLConfigs
{param($ServiceName)
$scriptPath = ($env:toolBoxXML + "\etc\toolBox.xml")
$configPathRoot = ($env:toolBoxXML + "\etc\")
$libScriptPathRoot = ($env:toolBoxXML + "\lib\")
$ToolboxConfig = [xml](gc $scriptPath)
if ($ServiceName)
{
if ($ToolboxConfig.toolBox.Services.$ServiceN... |
PowerShellCorpus/Github/aaronsb_posh-thycotic/toolboxcore/Get-SecurityRoles.ps1 | Get-SecurityRoles.ps1 | function Get-SecurityRoles
{
##
## Contains functions for identifying protected roles the current user has tokens for.
##
## Intended for dot-sourcing.
##
##
$identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$principal = New-Object System.Security.Principal.WindowsPrincipal( $identity ... |
PowerShellCorpus/Github/aaronsb_posh-thycotic/toolboxcore/install-toolbox.ps1 | install-toolbox.ps1 | function install-toolbox
{
param($computer)
$config = [xml](gc ($env:toolBoxXML + "\toolbox.xml"))
#probably do some sort of git pull thinger in here to install the whole shebang on another computer.
#yep, I haven't written that yet.
} |
PowerShellCorpus/Github/aaronsb_posh-thycotic/toolboxcore/Invoke-SQLCommand.ps1 | Invoke-SQLCommand.ps1 | ##############################################################################
##
## Invoke-SqlCommand
##
## From Windows PowerShell Cookbook (O'Reilly)
## by Lee Holmes (http://www.leeholmes.com/guide)
##
##
##############################################################################
<#
.SYNOPSIS
Re... |
PowerShellCorpus/Github/aaronsb_posh-thycotic/toolboxcore/Get-CachedCredential.ps1 | Get-CachedCredential.ps1 | function Get-CachedCredential
{
param($CredPath,$IntegratedCred,[switch]$ListCreds)
<#
.SYNOPSIS
Stores a credential as a session encrypted xml file on the machine.
.EXAMPLE
Get-MyCredential -CredPath $CredPath
If a credential is stored in $CredPath, it will be used.
If no credential is found, ... |
PowerShellCorpus/Github/OPS-E2E-Prod_E2E_P_D_Provision_2017_6_2_11_0_31/.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/DutchHarry_GMC/20161103 Get GMC data d.ps1 | 20161103 Get GMC data d.ps1 | <#
Errors
Purpose:
extract GMC data using a list og GMC numbers from file
Notes
First tricky bit is to properly control IE.
Seems only possible by checking page title (in this case), so you must first let IE do its thing, then check if there is a title, and then check it's the right title.
Obviously... |
PowerShellCorpus/Github/DutchHarry_GMC/20161103 Get GMC data x.ps1 | 20161103 Get GMC data x.ps1 | <#
Errors
surname, given names mix up in data
Purpose:
extract GMC data using a list og GMC numbers from file
Notes
First tricky bit is to properly control IE.
Seems only possible by checking page title (in this case), so you must first let IE do its thing, then check if there is a title, and then check i... |
PowerShellCorpus/Github/Vincoll_PS_NetworkShortcutTreeview/Set_NtwShortcut.ps1 | Set_NtwShortcut.ps1 |
<#
.SYNOPSIS
Based on Windows Explorer Network Location;
Create Network shortcuts TreeView from .csv
.NOTES
Only User browseable Paths will be create/display as Shortcut
You can change the .ico
.AUTHOR
Vincent Collard (@Vincoll)
... |
PowerShellCorpus/Github/TarasHrechyn_University/ITES_Labs/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/TarasHrechyn_University/ITES_Labs/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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.