full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/jring85_HelloWorld/HelloWorldGitHub/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/jring85_HelloWorld/HelloWorldGitHub/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/jring85_HelloWorld/HelloWorldGitHub/packages/Newtonsoft.Json.6.0.3/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/Samkovskyi_SpikeSFEvents/SpikeSFEvents/Scripts/Deploy-FabricApplication.ps1
Deploy-FabricApplication.ps1
<# .SYNOPSIS Deploys a Service Fabric application type to a cluster. .DESCRIPTION This script deploys a Service Fabric application type to a cluster. It is invoked by Visual Studio when deploying a Service Fabric Application project. .NOTES WARNING: This script file is invoked by Visual Studio. Its paramet...
PowerShellCorpus/Github/ottogori_Posh-Logger/code/PathFunctions.ps1
PathFunctions.ps1
. "$PSScriptRoot\Logger.ps1" function New-OPSDirectory { [CmdletBinding()] Param( [parameter(Position = 0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true )][Alias('FullName')] [ValidateNotNullOrEmpty()][string]$pa...
PowerShellCorpus/Github/ottogori_Posh-Logger/code/Log.ps1
Log.ps1
<#New-OPSLogFile .SYNOPSIS Create new log file .DESCRIPTION Creates a new log file on $logPath directory following the naming convention below. [Current date as dd-MM-yyyy] [$actionName] [$logType].log Examples: 11-02-2016 Update detailed.log 11-02-2016 Update summary.log ...
PowerShellCorpus/Github/ottogori_Posh-Logger/code/Logger.ps1
Logger.ps1
. "$PSScriptRoot\Log.ps1" . "$PSScriptRoot\StepException.ps1" <#New-OPSLogger .SYNOPSIS Create a new pair of summary and detailed log files. .DESCRIPTION Creates two new log files on $logPath directory, one for detailed log and one for summary log, following the naming convention below. [Current ...
PowerShellCorpus/Github/ottogori_Posh-Logger/code/StepException.ps1
StepException.ps1
function New-OPSStepException{ [CmdletBinding()] param( [ValidateNotNullOrEmpty()][string]$step = $(throw "step is mandatory and was not set."), [ValidateNotNullOrEmpty()][string]$message = $(throw "message is mandatory and was not set."), $invocation = $(throw "invocation is mandatory and was not set....
PowerShellCorpus/Github/ottogori_Posh-Logger/code/main.ps1
main.ps1
. "$PSScriptRoot\Logger.ps1" . "$PSScriptRoot\PathFunctions.ps1" Function Main { [CmdletBinding()] param( [parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()][string]$sConfigFilePath ) process{ # Set power shell stream handling preferences $VerbosePreference = "Continue" ...
PowerShellCorpus/Github/sunbinzhu_TestTemplates/create-hpc-cluster-existing-domain/PrepareHN.ps1
PrepareHN.ps1
param ( [Parameter(Mandatory=$true, ParameterSetName='NodePrepare')] [String] $DomainFQDN, [Parameter(Mandatory=$true, ParameterSetName='NodePrepare')] [String] $AdminUserName, # The admin password is in base64 string [Parameter(Mandatory=$true, ParameterSetName='NodePrepare'...
PowerShellCorpus/Github/sunbinzhu_TestTemplates/create-hpc-cluster-existing-domain/HPCHNPrepare.ps1
HPCHNPrepare.ps1
<# .Synopsis Prepare the HPC Pack head node. .DESCRIPTION This script promotes the virtual machine created from HPC Image to a HPC head node. .NOTES This cmdlet requires: 1. The current computer is a virtual machine created from HPC Image. 2. The current computer is domain joined. 3...
PowerShellCorpus/Github/benjaminragan_Google-Dynamic-DNS-Update/GoogleDNSUpdate.ps1
GoogleDNSUpdate.ps1
<# This Powershell script allows for updating a Google Dynamic DNS as defined in https://support.google.com/domains/answer/6147083 #> $username = '' # Username provided by Google $password = '' # Password provided by Google $domain = '' # Dynamic DNS Domain $GoogleDNSUpdateAddress = "https://domains.googl...
PowerShellCorpus/Github/chrissimpson-mandiant_SearchUrlID/SearchUrlID.ps1
SearchUrlID.ps1
<# .SYNOPSIS Script for returning the subject line of messages based on the OWA Url ID .DESCRIPTION This script accepts a text file with OWA URL ID strings and searches a specified mailbox for those strings. .PARAMETER EmailAddress The full primary SMTP email address for the mailbox to be searched. The par...
PowerShellCorpus/Github/dotps1_PSGist/Invoke-AppveyorBuild.ps1
Invoke-AppveyorBuild.ps1
#requires -Modules Configuration, Pester, PSScriptAnalyzer try { Set-Location -Path $env:APPVEYOR_BUILD_FOLDER -ErrorAction Stop $timestamp = Get-Date -uformat "%Y%m%d-%H%M%S" $resultsFile = "Results_${timestamp}.xml" Import-Module -Name .\$env:APPVEYOR_PROJECT_NAME -Force -ErrorAction Stop ...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Private/Invoke-GistApi.ps1
Invoke-GistApi.ps1
Function Invoke-GistApi { [CmdletBinding()] Param ( [Parameter( Mandatory = $false )] [HashTable] $Headers = @{ }, [Parameter( Mandatory = $true )] [String] $Method, [Parameter( ...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Private/PSGist.Classes.ps1
PSGist.Classes.ps1
Class Gist { [Int]$Comments [Uri]$CommentsUrl [Uri]$CommitsUrl [DateTime]$CreatedAt [string]$Description [GistFile[]]$Files [GistFork[]]$Forks [Uri]$ForksUrl [GistHistory[]]$History [Uri]$HtmlUrl [String]$Id [GistUser]$Owner [Bool]$Public [Uri]$PullU...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Add-GistComment.ps1
Add-GistComment.ps1
Function Add-GistComment { [CmdletBinding( HelpUri = "http://dotps1.github.io/PSGist/Add-GistComment.html" )] [OutputType( [GistComment] )] Param ( [Parameter( HelpMessage = "The Id of the Gist Object.", Mandatory = $true, Valu...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Save-Gist.ps1
Save-Gist.ps1
Function Save-Gist { [CmdletBinding( HelpUri = "http://dotps1.github.io/PSGist/Save-Gist.html" )] [OutputType( [IO.FileInfo] )] Param ( [Parameter( HelpMessage = "Path to save the Gist Object." )] [String] $Path = "$env:APPDAT...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Get-Gist.ps1
Get-Gist.ps1
Function Get-Gist { [CmdletBinding( DefaultParameterSetName = "__AllParameterSets", HelpUri = "http://dotps1.github.io/PSGist/Get-Gist.html" )] [OutputType( [Gist] )] Param ( [Parameter( HelpMessage = "The username of the GitHub User.", ...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Copy-Gist.ps1
Copy-Gist.ps1
Function Copy-Gist { [CmdletBinding( HelpUri = "http://dotps1.github.io/PSGist/Copy-Gist.html" )] [OutputType( [Gist] )] Param ( [Parameter( HelpMessage = "The Id of the Gist Object.", Mandatory = $true, ValueFromPipeline = $tr...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Get-GistVersion.ps1
Get-GistVersion.ps1
Function Get-GistVersion { [CmdletBinding( HelpUri = "http://dotps1.github.io/PSGist/Get-GistVersion.html" )] [OutputType( [Gist] )] Param ( [Parameter( HelpMessage = "The Id of the Gist Object.", Mandatory = $true, ValueFromP...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Get-GistComment.ps1
Get-GistComment.ps1
Function Get-GistComment { [CmdletBinding( HelpUri = "http://dotps1.github.io/PSGist/Get-GistComment.html" )] [OutputType([GistComment])] Param ( [Parameter( HelpMessage = "The Id of the Gist Object.", Mandatory = $true, ValueFromPipelin...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Get-GistCommit.ps1
Get-GistCommit.ps1
Function Get-GistCommit { [CmdletBinding( HelpUri = "http://dotps1.github.io/PSGist/Get-GistCommit.html" )] [OutputType( [GistHistory] )] Param ( [Parameter( HelpMessage = "The Id of the Gist Object.", Mandatory = $true, ValueF...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Remove-GistFile.ps1
Remove-GistFile.ps1
function Remove-GistFile { [CmdletBinding( ConfirmImpact = "High", HelpUri = "http://dotps1.github.io/PSGist/Remove-GistFile.html", SupportsShouldProcess = $true )] [OutputType( [Void] )] Param ( [Parameter( HelpMessage = "The Id of th...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/New-Gist.ps1
New-Gist.ps1
Function New-Gist { [CmdletBinding( ConfirmImpact = "Low", HelpUri = "http://dotps1.github.io/PSGist/New-Gist.html", SupportsShouldProcess = $true )] [OutputType( [Gist] )] Param ( [Parameter( HelpMessage = "Path to file(s) where the c...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Find-Gist.ps1
Find-Gist.ps1
Function Find-Gist { [CmdletBinding()] [OutputType( [Gist] )] Param ( [Parameter( HelpMessage = "The username of the GitHub User." )] [String] $Owner = ((Import-Clixml -Path $env:AppData\PSGist\Private\OAuthToken.xml -ErrorAction Stop).Ge...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/New-GistOAuthToken.ps1
New-GistOAuthToken.ps1
Function New-GistOAuthToken { [CmdletBinding( ConfirmImpact = "Low", HelpUri = "http://dotps1.github.io/PSGist/New-GistOAuthToken.html", SupportsShouldProcess = $true )] [OutputType( [String] )] Param ( [Parameter( HelpMessage = "PSCre...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Remove-Gist.ps1
Remove-Gist.ps1
function Remove-Gist { [CmdletBinding( ConfirmImpact = "High", HelpUri = "http://dotps1.github.io/PSGist/Remove-Gist.html", SupportsShouldProcess = $true )] [OutputType( [Void] )] Param ( [Parameter( HelpMessage = "The Id of the Gist O...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Get-GistFork.ps1
Get-GistFork.ps1
Function Get-GistFork { [CmdletBinding( HelpUri = "http://dotps1.github.io/PSGist/Get-GistFork.html" )] [OutputType( [GistFork] )] Param ( [Parameter( HelpMessage = "The Id of the Gist Object.", Mandatory = $true, ValueFromPip...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Update-GistFile.ps1
Update-GistFile.ps1
Function Update-GistFile { [CmdletBinding( ConfirmImpact = "Medium", HelpUri = "http://dotps1.github.io/PSGist/Update-GistFile.html", SupportsShouldProcess = $true )] [OutputType( [Gist] )] Param ( [Parameter( HelpMessage = "The Id of...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Add-GistFile.ps1
Add-GistFile.ps1
Function Add-GistFile { [CmdletBinding( HelpUri = "http://dotps1.github.io/PSGist/Add-GistFile.html" )] [OutputType( [Gist] )] Param ( [Parameter( HelpMessage = "The Id of the Gist Object.", Mandatory = $true, ValueFromPipeline...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Rename-GistFile.ps1
Rename-GistFile.ps1
Function Rename-GistFile { [CmdletBinding( HelpUri = "http://dotps1.github.io/PSGist/Rename-GistFile.html" )] [OutputType( [Gist] )] Param ( [Parameter( HelpMessage = "The Id of the Gist Object.", Mandatory = $true, ValueFr...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Set-Gist.ps1
Set-Gist.ps1
Function Set-Gist { [CmdletBinding( ConfirmImpact = "Low", HelpUri = "http://dotps1.github.io/PSGist/Set-Gist.html", SupportsShouldProcess = $true )] [OutputType( [Gist], [Void] )] Param ( [Parameter( HelpMessage = "The Id...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Remove-GistComment.ps1
Remove-GistComment.ps1
Function Remove-GistComment { [CmdletBinding( ConfirmImpact = "High", HelpUri = "http://dotps1.github.io/PSGist/Remove-GistComment.html", SupportsShouldProcess = $true )] [OutputType( [Void] )] Param ( [Parameter( HelpMessage = "The Id...
PowerShellCorpus/Github/dotps1_PSGist/PSGist/Public/Update-GistComment.ps1
Update-GistComment.ps1
Function Update-GistComment { [CmdletBinding( ConfirmImpact = "Medium", HelpUri = "http://dotps1.github.io/PSGist/Update-GistComment.html", SupportsShouldProcess = $true )] [OutputType( [GistComment] )] Param ( [Parameter( HelpMessage ...
PowerShellCorpus/Github/dotps1_PSGist/Tests/Update-GistComment.Tests.ps1
Update-GistComment.Tests.ps1
Describe "Update-GistComment" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Update-GistComment.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Update-GistComment.ps1 It "Invoke-ScriptAnalyzer results of Update-GistComment count should be 0." ...
PowerShellCorpus/Github/dotps1_PSGist/Tests/Remove-GistFile.Tests.ps1
Remove-GistFile.Tests.ps1
Describe "Remove-GistFile" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Remove-GistFile.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Remove-GistFile.ps1 It "Invoke-ScriptAnalyzer results of Remove-GistFile count should be 0." { ...
PowerShellCorpus/Github/dotps1_PSGist/Tests/Remove-Gist.Tests.ps1
Remove-Gist.Tests.ps1
Describe "Remove-Gist" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Remove-Gist.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Remove-Gist.ps1 It "Invoke-ScriptAnalyzer results of Remove-Gist count should be 0." { $results.Coun...
PowerShellCorpus/Github/dotps1_PSGist/Tests/New-GistOAuthToken.Tests.ps1
New-GistOAuthToken.Tests.ps1
Describe "New-GistOAuthToken" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\New-GistOAuthToken.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\New-GistOAuthToken.ps1 -ExcludeRule PSAvoidUsingConvertToSecureStringWithPlainText It "Invoke-Scrip...
PowerShellCorpus/Github/dotps1_PSGist/Tests/Set-Gist.Tests.ps1
Set-Gist.Tests.ps1
Describe "Set-Gist" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Set-Gist.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Set-Gist.ps1 It "Invoke-ScriptAnalyzer results of Set-Gist count should be 0." { $results.Count | Should B...
PowerShellCorpus/Github/dotps1_PSGist/Tests/Remove-GistComment.Tests.ps1
Remove-GistComment.Tests.ps1
Describe "Remove-GistComment" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Remove-GistComment.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Remove-GistComment.ps1 It "Invoke-ScriptAnalyzer results of Remove-GistComment count should be 0." ...
PowerShellCorpus/Github/dotps1_PSGist/Tests/Find-Gist.Tests.ps1
Find-Gist.Tests.ps1
Describe "Find-GistFile" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Find-GistFile.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Update-GistFile.ps1 It "Invoke-ScriptAnalyzer results of Find-GistFile count should be 0." { $re...
PowerShellCorpus/Github/dotps1_PSGist/Tests/Add-GistFile.Tests.ps1
Add-GistFile.Tests.ps1
Describe "Add-GistFile" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Add-GistFile.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Add-GistFile.ps1 It "Invoke-ScriptAnalyzer results of Add-GistFile count should be 0." { $results....
PowerShellCorpus/Github/dotps1_PSGist/Tests/Save-Gist.Tests.ps1
Save-Gist.Tests.ps1
Describe "Save-Gist" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Save-Gist.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Save-Gist.ps1 It "Invoke-ScriptAnalyzer results of Save-Gist count should be 0." { $results.Count | Shou...
PowerShellCorpus/Github/dotps1_PSGist/Tests/Get-GistCommit.Tests.ps1
Get-GistCommit.Tests.ps1
Describe "Get-GistCommit" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Get-GistCommit.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Get-GistCommit.ps1 It "Invoke-ScriptAnalyzer results of Get-GistCommit count should be 0." { $...
PowerShellCorpus/Github/dotps1_PSGist/Tests/Get-GistVersion.Tests.ps1
Get-GistVersion.Tests.ps1
Describe "Get-GistVersion" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Get-GistVersion.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Get-GistVersion.ps1 It "Invoke-ScriptAnalyzer results of Get-GistVersion count should be 0." { ...
PowerShellCorpus/Github/dotps1_PSGist/Tests/Add-GistComment.Tests.ps1
Add-GistComment.Tests.ps1
Describe "Add-GistComment" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Add-GistComment.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Add-GistComment.ps1 It "Invoke-ScriptAnalyzer results of Add-GistComment count should be 0." { ...
PowerShellCorpus/Github/dotps1_PSGist/Tests/Rename-GistFile.Tests.ps1
Rename-GistFile.Tests.ps1
Describe "Rename-GistFile" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Rename-GistFile.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Rename-GistFile.ps1 It "Invoke-ScriptAnalyzer results of Rename-GistFile count should be 0." { ...
PowerShellCorpus/Github/dotps1_PSGist/Tests/Update-GistFile.Tests.ps1
Update-GistFile.Tests.ps1
Describe "Update-GistFile" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Update-GistFile.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Update-GistFile.ps1 It "Invoke-ScriptAnalyzer results of Update-GistFile count should be 0." { ...
PowerShellCorpus/Github/dotps1_PSGist/Tests/Copy-Gist.Tests.ps1
Copy-Gist.Tests.ps1
Describe "Copy-Gist" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Copy-Gist.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Copy-Gist.ps1 It "Invoke-ScriptAnalyzer results of Copy-Gist count should be 0." { $results.Count | Shou...
PowerShellCorpus/Github/dotps1_PSGist/Tests/Get-GistComment.Tests.ps1
Get-GistComment.Tests.ps1
Describe "Get-GistComment" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Get-GistComment.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Get-GistComment.ps1 It "Invoke-ScriptAnalyzer results of Get-GistComment count should be 0." { ...
PowerShellCorpus/Github/dotps1_PSGist/Tests/Get-Gist.Tests.ps1
Get-Gist.Tests.ps1
Describe "Get-Gist" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Get-Gist.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Get-Gist.ps1 It "Invoke-ScriptAnalyzer results of Get-Gist count should be 0." { $results.Count | Should B...
PowerShellCorpus/Github/dotps1_PSGist/Tests/New-Gist.Tests.ps1
New-Gist.Tests.ps1
Describe "New-Gist" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\New-Gist.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\New-Gist.ps1 It "Invoke-ScriptAnalyzer results of New-Gist count should be 0." { $results.Count | Should B...
PowerShellCorpus/Github/dotps1_PSGist/Tests/Get-GistFork.Tests.ps1
Get-GistFork.Tests.ps1
Describe "Get-GistFork" { Context "Invoke-ScriptAnalyzer -Path $(Resolve-Path -Path (Get-Location))\Public\Get-GistFork.ps1." { $results = Invoke-ScriptAnalyzer -Path .\PSGist\Public\Get-GistFork.ps1 It "Invoke-ScriptAnalyzer results of Get-GistFork count should be 0." { $results....
PowerShellCorpus/Github/tmasternak_AzureWebSites101/AzureWebsite101/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/vandsh_sitecore-ship-utils/publish-sitecorepackage.ps1
publish-sitecorepackage.ps1
<# This function "smart" publishes the specified Sitecore target to the given $SiteUrl. Example usage: .\publish-sitecorepackage.ps1 mysite.dev "preview,web" "en" "smart" 300 .\publish-sitecorepackage.ps1 mysite.dev "preview,web" "en" "listofitems" 300 MyUserName MyPassword "C:/temp/ids.txt" #> Pa...
PowerShellCorpus/Github/vandsh_sitecore-ship-utils/deploy-sitecorepackage.ps1
deploy-sitecorepackage.ps1
<# This function uploads & installs the specified Sitecore update package to the given $SiteUrl. Example usage: .\deploy-sitecorepackage.ps1 mysite.dev "C:\Project\Build\Artifacts\1-mysite-templates.update" 300 MyUsername MyPassword .\deploy-sitecorepackage.ps1 mysite.dev "C:\Project\Build\Artifacts\1-...
PowerShellCorpus/Github/vandsh_sitecore-ship-utils/multipartFormDataUpload.ps1
multipartFormDataUpload.ps1
function Invoke-MultipartFormDataUpload { [CmdletBinding()] PARAM ( [string][parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$InFile, [string]$ContentType, [Uri][parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$Uri, [System.Management.Automation.PSCreden...
PowerShellCorpus/Github/nichiwa-specialist_env/gae-go/tools/chocolateyuninstall.ps1
chocolateyuninstall.ps1
# IMPORTANT: Before releasing this package, copy/paste the next 2 lines into PowerShell to remove all comments from this file: # $f='c:\path\to\thisFile.ps1' # gc $f | ? {$_ -notmatch "^\s*#"} | % {$_ -replace '(^.*?)\s*?[^``]#.*','$1'} | Out-File $f+".~" -en utf8; mv -fo $f+".~" $f # If this is an MSI, cleani...
PowerShellCorpus/Github/nichiwa-specialist_env/gae-go/tools/chocolateyinstall.ps1
chocolateyinstall.ps1
# IMPORTANT: Before releasing this package, copy/paste the next 2 lines into PowerShell to remove all comments from this file: # $f='c:\path\to\thisFile.ps1' # gc $f | ? {$_ -notmatch "^\s*#"} | % {$_ -replace '(^.*?)\s*?[^``]#.*','$1'} | Out-File $f+".~" -en utf8; mv -fo $f+".~" $f $ErrorActionPreference = 'S...
PowerShellCorpus/Github/t-ha_feb08-344/AzureCloudService1/packages/Newtonsoft.Json.8.0.2/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/t-ha_feb08-344/AzureCloudService1/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/t-ha_feb08-344/AzureCloudService1/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/KuMan1ac_PowerShellScripts/batchDeployVMs.ps1
batchDeployVMs.ps1
<# # Modified by Li Yang, Originally Scripted by Lei Long. Use With Caution and Responsibility #> Write-Host -ForegroundColor Red -BackgroundColor Black "VM Batch Deploy Script=====Use With Caution=====" # Read a file contains VM names to be deployed. $VMList=Get-Content -Path D:\vmlist.txt Echo $VMList $confir...
PowerShellCorpus/Github/KuMan1ac_PowerShellScripts/calculateResourceByVLANID.ps1
calculateResourceByVLANID.ps1
# Get vm on the host $vms=get-vm # Build a list $list=New-Object System.Collections.ArrayList # 102,103... are VLANIDs foreach ($i in(102,103,105,107,108,109,160)) { [void]$list.Add($i.ToString())} [int]$mem=0 [int]$stg=0 # filter foreach($vlan in $list) { # 2 lists for temp storage for calculation...
PowerShellCorpus/Github/KuMan1ac_PowerShellScripts/batchUpdateCloud&BizOwner.ps1
batchUpdateCloud&BizOwner.ps1
# Specifiy a private cloud name in Virtual Machine Manager $cloudname="Private-Cloud" $cloud=Get-SCCloud -Name $cloudname # Read a file of VMs need to be updated... $vmlist=Get-Content -Path D:\vmlist.txt foreach($ivm in $vmlist){ $vm=Get-SCVirtualMachine -Name $ivm Set-SCVirtualMachine -VM $vm -De...
PowerShellCorpus/Github/KuMan1ac_PowerShellScripts/getHostMemory.ps1
getHostMemory.ps1
# If the output file exists, remove it first Remove-Item -Path D:\ShareWithEveryone\meminfo.txt # Read server list file $hostlist=Get-Content D:\srvlist.txt foreach($ihost in $hostlist) { Invoke-Command -ComputerName $ihost -ScriptBlock{ $freemem = Get-WmiObject -Class Win32_OperatingSystem # Display fre...
PowerShellCorpus/Github/KuMan1ac_PowerShellScripts/deployNewVM.ps1
deployNewVM.ps1
Write-Host -NoNewline -ForegroundColor Magenta 'Specify a name for new VM :' [String]$FS_VMName = Read-Host Write-Host -NoNewline -ForegroundColor Magenta 'Specify a host server :' [String]$FS_HostName= Read-Host # Modify mem and virtual CPU cores $Memory = 4GB $CpuCount = 4 # Specify a virtual switch for ne...
PowerShellCorpus/Github/KuMan1ac_PowerShellScripts/removeDisabledADUserMembership.ps1
removeDisabledADUserMembership.ps1
<# # @author= Young Li # @description= Remove disabled account group membership under a specified OU. # @Usage= You might want to change variable OU... # @Notice. You can`t remove the Domain User group from a Disabled User #> # Specify an OU that all Disabled Users Exist $OU="OU=Disabled,OU=Beijing,DC=xlab...
PowerShellCorpus/Github/KuMan1ac_PowerShellScripts/batchAddVHD.ps1
batchAddVHD.ps1
$vhdsize=1TB $vhdpath="\\PWSR252018\D_SMB_VMs" $list=Get-Content -Path D:\vhd.txt $vmname="VLNX034027" foreach($i in $list){ Write-Host "Creating $vhdpath\$i" New-VHD -Path "$vhdpath\$i" -SizeBytes $vhdsize -Dynamic Add-VMHardDiskDrive -VMName $vmname -ControllerType SCSI -ControllerNumber 0 -P...
PowerShellCorpus/Github/KuMan1ac_PowerShellScripts/checkDiskUsage.ps1
checkDiskUsage.ps1
<# # Check Disk Usage Script. # By Kuma Ver 1.0 #> # Read a List of Servers $srvlist=Get-Content -Path D:\srvlist.txt # Some Calculation foreach($ihost in $srvlist){ Invoke-Command -ComputerName $ihost -ScriptBlock{ Write-Host -ForegroundColor Cyan "Working on",$env:COMPUTERNAME "..." ...
PowerShellCorpus/Github/KuMan1ac_PowerShellScripts/HyperVHostNetwork.ps1
HyperVHostNetwork.ps1
# Some useful cmdlets for Hyper-V host server network Configuration. # Windows Server 2016 cmdlets differ from 2012 ones... # 2016 Version. # 1. Set Nic Teamming New-NetLbfoTeam -Name NICTeam -TeamNicName Public -TeamMembers "NIC1,NIC2" -TeamingMode SwitchIndependent -LoadBalancingAlgorithm Dynamic # 2. Cr...
PowerShellCorpus/Github/KuMan1ac_PowerShellScripts/splitExample.ps1
splitExample.ps1
# Read a CSV file contains SMB paths of a bunch of files $csv=Get-Content -Path C:\Users\liy\Desktop\wharehouse1.csv foreach($ir in $csv) { # Split the SMB path and build a new bath for copying. $split=$ir.Split("\\") $path="E:\VCST0002FS01_VDSK0001_01$\"+$split.Get(10)+"\"+$split.Get(12)+"\"+$split.G...
PowerShellCorpus/Github/zhakutov_powercli/1.ps1
1.ps1
Write-Host "Welcome $args !!! Congratulations, you have run your first script!!!"
PowerShellCorpus/Github/zhakutov_powercli/Luns_Info.ps1
Luns_Info.ps1
# PowerCLI Script for collecting the details of storage connected to a cluster. # .DESCRIPTION # This PowerCLI scritpt will help to identify how the disks/LUNs connected to the host are presented(RDM,VMFS or None). # .VERSION # v1.1 # .NOTES # File Name : Get-DiskDetails.ps1 # Author : Sreejesh Damodaran # Requ...
PowerShellCorpus/Github/zhakutov_powercli/set_RR_host.ps1
set_RR_host.ps1
#Set Round Robin to all hosts in Production cluster $viserver = Set-Cluster "Please enter vCenter Server:" connect-viserver $viserver Get-VMHost -Location 'Chagala(131)'|Get-ScsiLun -LunType "disk"|where {$_.MultipathPolicy -ne "RoundRobin"}|where {$_.MultipathPolicy -ne "Fixed"} | Set-ScsiLun -MultipathPolicy Round...
PowerShellCorpus/Github/zhakutov_powercli/Collect_log.ps1
Collect_log.ps1
Get-VMHost ncatesxp01.ncoc.adloc | Get-Log -Bundle -DestinationPath C:\Users\NK31002008\Desktop\ get-view -ViewType VirtualMachine -Filter @{'RunTime.ConnectionState'='disconnected|inaccessible|invalid|orphaned'} | select name
PowerShellCorpus/Github/zhakutov_powercli/User_logs.ps1
User_logs.ps1
$vmhosts = Get-VMHost -Location (Get-Cluster NCOC-UCS) $logs = $vmhosts | Get-Log -Key 'hostd' $logs.Entries | Select-String -Pattern "NCOC\zAdm-Zhakutov" #Get-VMHost -Location (Get-Datacenter *) $vmhost = Get-VMHost 'ncatesxp31.ncoc.adloc' $logs = $vmhost | Get-Log -Key 'hostd' $logs.Entries | Select-String ...
PowerShellCorpus/Github/zhakutov_powercli/new_last.ps1
new_last.ps1
Set-ExecutionPolicy Unrestricted ### Get-Module Import-Module 'C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VimAutomation.vROps' Connect-VIServer -Server ncatvcsv02 -User 'ncoc\zadm-zhakutov' -Password 'zh@kutov2016' connect-omserver ncatmonv003.ncjvkz.com -User admin -Password vcOm@2016 ...
PowerShellCorpus/Github/zhakutov_powercli/Fins_MAC.ps1
Fins_MAC.ps1
Connect-VIServer -Server kzatmgr0001 -User 'okioc.com\zSvc-VC4Admin' -Password '!_l!k3_e$}{' Connect-VIServer -Server ncatvcev01 -User 'ncoc\zadm-zhakutov' -Password 'zh@kutov1978' Import-Module 'C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VimAutomation.vROps' Import-Module 'C:\Program F...
PowerShellCorpus/Github/zhakutov_powercli/vmtools_update.ps1
vmtools_update.ps1
##################################################################### # # Purpose: "Check and upgrade Tools during power cycling" # Author: David Chung # Support: IT Infrastructure # Docs: N/A # # Instruction: 1. Create CSV file with list of servers # 2. Execute script from PowerCLI # 3. E...
PowerShellCorpus/Github/zhakutov_powercli/Test_VMs_ping.ps1
Test_VMs_ping.ps1
Get-VM | Select Name,PowerState, @{N="Ping";E={ if($_.PowerState -eq "PoweredOn" -and (Test-Connection -ComputerName $_.Name)){"Online"}else{"Offline"} }} | Export-Csv C:\Users\zadm-zhakutov\Desktop\VM-status.csv -NoTypeInformation -UseCulture
PowerShellCorpus/Github/zhakutov_powercli/Delete_VMs.ps1
Delete_VMs.ps1
$VMs = (Get-Content C:\Users\zadm-zhakutov\Desktop\servers.txt) $vmObj = Get-vm $vms foreach($active in $vmObj){ if($active.PowerState -eq "PoweredOn"){ Stop-VM -VM $active -Confirm:$false -RunAsync | Out-Null} } Start-Sleep -Seconds 7 foreach($delete in $vmObj){ Remove-VM -VM $delete -DeletePermanently ...
PowerShellCorpus/Github/zhakutov_powercli/VMDK-orphaned.ps1
VMDK-orphaned.ps1
$report = @() $arrUsedDisks = Get-View -ViewType VirtualMachine | % {$_.Layout} | % {$_.Disk} | % {$_.DiskFile} $arrDS = Get-Datastore | Sort-Object -property Name foreach ($strDatastore in $arrDS) { Write-Host $strDatastore.Name $ds = Get-Datastore -Name $strDatastore.Name | % {Get-View $_.Id} $fileQueryFlags...
PowerShellCorpus/Github/caofangsheng93_MyProject/IocNiject/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/caofangsheng93_MyProject/IocNiject/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/caofangsheng93_MyProject/IocNiject/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/caofangsheng93_MyProject/IocNiject/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/caofangsheng93_MyProject/IocNiject/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/caofangsheng93_MyProject/IocNiject/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/caofangsheng93_MyProject/IocNiject/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/caofangsheng93_MyProject/IocNiject/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/aegschen_IEStarter/StartOpenIE3MHigh.ps1
StartOpenIE3MHigh.ps1
## IEStarter (Opens some IE windows on three monitors.) ## Version: 1.1 (30.01.2017) Function Wait_IE ($ieX) { while($ieX.Busy -eq $true){Start-Sleep -Milliseconds 5000} } # Monitor 1 IE-Frame 1 if (!$site_addrA) { $site_addrA = "http://www.heise.de" } # Monitor 1 IE-Frame 2 if (!$site_addrB) ...
PowerShellCorpus/Github/RuelleJoelleSmartView_SPSParis2016/demo1.ps1
demo1.ps1
#Import du module Azure Active Directory module dans notre session PowerShell Import-Module MSOnline #Création de l’objet d’identification utilisateur $credential = get-credential #Etablissement de la connexion avec Azure Active Directory Connect-MsolService -Credential $credential #Listage des propriété e...
PowerShellCorpus/Github/RuelleJoelleSmartView_SPSParis2016/demo2.ps1
demo2.ps1
#Création de l’objet d’identification utilisateur $credential = Get-Credential ################################################################################################################################################################################################################## ###### Demo Skype #####...
PowerShellCorpus/Github/TestYajun_E2E_P_SR/.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/pratom_expand_error/describe_global_errors_briefly.ps1
describe_global_errors_briefly.ps1
Function describe_global_errors_briefly { $descriptions = "" $counter = 0 if ($Global:error -eq $null) { $descriptions = "`$Global:error is NULL ????" } else { $copied = ( $Global:error | foreach { $_ } ) $copied | Foreach { $descri...
PowerShellCorpus/Github/pratom_expand_error/describe_error_briefly.ps1
describe_error_briefly.ps1
Function describe_error_briefly { [cmdletbinding()] Param ( [Parameter(ParameterSetName='ParseException', Position=0, Mandatory = $true)] [System.Management.Automation.ParseException] $parse_exception_to_read ,[Parameter(ParameterSetNa...
PowerShellCorpus/Github/pratom_expand_error/describe_error.ps1
describe_error.ps1
<# DONE_TODO: create an object, pass around in descriptions, instead of the string. add to the object the overall message. Add to the object as per the property. So, if message, add to object's message, if stacktrace, add to the object's stack trace, if etc, etc. TODO: Exception =[Data ...
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/DomainAMachinesConfig.ps1
DomainAMachinesConfig.ps1
Configuration DomainConfig { param ( [Parameter(Mandatory)] [pscredential]$universalCred ) Import-DscResource -ModuleName xActiveDirectory Import-DscResource -ModuleName xComputerManagement Node $AllNodes.Where{$_.Role -eq "DC"}.Nodename { WindowsFe...