full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/powercode_IntroToPs/streams.ps1
streams.ps1
Write-Output 'This goes to the pipeline' Write-Error -Message 'Oops' -Category InvalidArgument -TargetObject @{ Value = 47; WasItChineseNewYear = $false} Write-Warning 'You shouldn''t run with scissors' Write-Debug 'Intended for the developers of the scripts' Write-Verbose 'Intended for the advanced user of the sc...
PowerShellCorpus/Github/powercode_IntroToPs/function4.ps1
function4.ps1
class Person { [string] $Name [int] $Age Person([string] $name, [int] $age) { $this.Name = $name $this.Age = $age } } function Get-Person { [OutputType([Person])] param( [Parameter(Mandatory, ValueFromPipelineByPropertyName)] [string] $Name, [Parameter(M...
PowerShellCorpus/Github/powercode_IntroToPs/getting_started.ps1
getting_started.ps1
Get-Command Get-Help Get-Member Get-Module Get-PSDrive Install-Module # Import-Module find-module pseverything
PowerShellCorpus/Github/rmbolger_Posh-IBWAPI/instdev.ps1
instdev.ps1
#Requires -Version 3.0 # create user-specific modules folder if it doesn't exist $targetondisk = "$($env:USERPROFILE)\Documents\WindowsPowerShell\Modules" New-Item -ItemType Directory -Force -Path $targetondisk | out-null if ([String]::IsNullOrWhiteSpace($PSScriptRoot)) { # likely running from online, so d...
PowerShellCorpus/Github/rmbolger_Posh-IBWAPI/Posh-IBWAPI/Private/Base.ps1
Base.ps1
function Base { [CmdletBinding()] param ( [string]$WAPIHost, [string]$WAPIVersion, [Parameter(ValueFromRemainingArguments = $true)] $Splat ) "https://$WAPIHost/wapi/v$WAPIVersion/" }
PowerShellCorpus/Github/rmbolger_Posh-IBWAPI/Posh-IBWAPI/Private/Initialize-CallVars.ps1
Initialize-CallVars.ps1
function Initialize-CallVars { [CmdletBinding()] param( [Alias('host')] [string]$WAPIHost, [Alias('version')] [string]$WAPIVersion, [PSCredential]$Credential, [Alias('session')] [Microsoft.PowerShell.Commands.WebRequestSession]$WebSession, ...
PowerShellCorpus/Github/rmbolger_Posh-IBWAPI/Posh-IBWAPI/Private/HighestVer.ps1
HighestVer.ps1
function HighestVer { [CmdletBinding()] param ( [Parameter(Mandatory=$true)] [string]$WAPIHost, [Parameter(Mandatory=$true)] [Microsoft.PowerShell.Commands.WebRequestSession]$WebSession, [switch]$IgnoreCertificateValidation ) try { # Query the...
PowerShellCorpus/Github/rmbolger_Posh-IBWAPI/Posh-IBWAPI/Public/Remove-IBObject.ps1
Remove-IBObject.ps1
function Remove-IBObject { [CmdletBinding(SupportsShouldProcess)] param( [Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)] [Alias('_ref','ref')] [string[]]$ObjectRef, [Alias('args')] [string[]]$DeleteArgs, [Alias('...
PowerShellCorpus/Github/rmbolger_Posh-IBWAPI/Posh-IBWAPI/Public/New-IBWAPISession.ps1
New-IBWAPISession.ps1
function New-IBWAPISession { [CmdletBinding()] param( [Parameter(Mandatory=$true,Position=0)] [Alias('host')] [string]$WAPIHost, [Parameter(Mandatory=$true,Position=1)] [PSCredential]$Credential, [switch]$IgnoreCertificateValidation ) # There'...
PowerShellCorpus/Github/rmbolger_Posh-IBWAPI/Posh-IBWAPI/Public/Invoke-IBWAPI.ps1
Invoke-IBWAPI.ps1
function Invoke-IBWAPI { [CmdletBinding(SupportsShouldProcess)] param( [Parameter(Mandatory=$true,Position=0)] [Uri]$Uri, [Microsoft.PowerShell.Commands.WebRequestMethod]$Method=([Microsoft.PowerShell.Commands.WebRequestMethod]::Get), [PSCredential]$Credential, [O...
PowerShellCorpus/Github/rmbolger_Posh-IBWAPI/Posh-IBWAPI/Public/Set-IBObject.ps1
Set-IBObject.ps1
function Set-IBObject { [CmdletBinding(SupportsShouldProcess)] param( [Parameter(ParameterSetName='ObjectOnly',Mandatory=$True,ValueFromPipeline=$True)] [PSObject[]]$IBObject, [Parameter(ParameterSetName='RefAndTemplate',Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineBy...
PowerShellCorpus/Github/rmbolger_Posh-IBWAPI/Posh-IBWAPI/Public/Get-IBWAPIConfig.ps1
Get-IBWAPIConfig.ps1
function Get-IBWAPIConfig { [CmdletBinding()] param( [string]$WAPIHost, [switch]$List ) if ($List) { # list all configs foreach ($hostConfig in $script:Config.Values) { [PSCustomObject]$hostConfig | Select-Object WAPIHost,WAPIVersion,Credential,Web...
PowerShellCorpus/Github/rmbolger_Posh-IBWAPI/Posh-IBWAPI/Public/Set-IBWAPIConfig.ps1
Set-IBWAPIConfig.ps1
function Set-IBWAPIConfig { [CmdletBinding()] param( [Alias('host')] [string]$WAPIHost, [Alias('version')] [string]$WAPIVersion, [PSCredential]$Credential, [Alias('session')] [Microsoft.PowerShell.Commands.WebRequestSession]$WebSession, ...
PowerShellCorpus/Github/rmbolger_Posh-IBWAPI/Posh-IBWAPI/Public/Get-IBObject.ps1
Get-IBObject.ps1
function Get-IBObject { [CmdletBinding(SupportsShouldProcess)] param( [Parameter(ParameterSetName='ByRef',Mandatory=$True,Position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)] [Alias('_ref','ref')] [string[]]$ObjectRef, [Parameter(ParameterSetName='B...
PowerShellCorpus/Github/rmbolger_Posh-IBWAPI/Posh-IBWAPI/Public/Invoke-IBFunction.ps1
Invoke-IBFunction.ps1
function Invoke-IBFunction { [CmdletBinding(SupportsShouldProcess)] param( [Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)] [Alias('_ref','ref')] [string[]]$ObjectRef, [Parameter(Mandatory=$True)] [Alias('name')] ...
PowerShellCorpus/Github/rmbolger_Posh-IBWAPI/Posh-IBWAPI/Public/New-IBObject.ps1
New-IBObject.ps1
function New-IBObject { [CmdletBinding(SupportsShouldProcess)] param( [Parameter(Mandatory=$True)] [Alias('type')] [string]$ObjectType, [Parameter(Mandatory=$True,ValueFromPipeline=$True)] [PSObject[]]$IBObject, [Alias('fields')] [string[]]$Retur...
PowerShellCorpus/Github/rmbolger_Posh-IBWAPI/Tests/Posh-IBWAPI.Tests.ps1
Posh-IBWAPI.Tests.ps1
PowerShellCorpus/Github/Maxyee_ASP.NET-MVC-CSharp/MvcMovie/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/Maxyee_ASP.NET-MVC-CSharp/MvcMovie/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/Maxyee_ASP.NET-MVC-CSharp/MvcMovie/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/Maxyee_ASP.NET-MVC-CSharp/MvcMovie/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/Maxyee_ASP.NET-MVC-CSharp/MvcMovie/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/Maxyee_ASP.NET-MVC-CSharp/MvcMovie/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/Maxyee_ASP.NET-MVC-CSharp/MvcMovie/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/Maxyee_ASP.NET-MVC-CSharp/MvcMovie/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/1RedOne_SCCM-FolderCmdlets/Remove-CMFolderApplications.ps1
Remove-CMFolderApplications.ps1
<# .Synopsis SCCM Shipped without a cmdlet to remove packages from a folder! This tool fixes that. .DESCRIPTION Use this tool to delete Packages which are within a folder in SCCM. Simply specify your folder name and site code, and the tool will enumerate the contents of a folder, find the right package ID, t...
PowerShellCorpus/Github/1RedOne_SCCM-FolderCmdlets/Remove-CMFolderPackages.ps1
Remove-CMFolderPackages.ps1
<# .Synopsis SCCM Shipped without a cmdlet to remove packages from a folder! This tool fixes that. .DESCRIPTION Use this tool to delete Packages which are within a folder in SCCM. Simply specify your folder name and site code, and the tool will enumerate the contents of a folder, find the right package ID, t...
PowerShellCorpus/Github/1RedOne_SCCM-FolderCmdlets/Remove-CMFolderDrivers.ps1
Remove-CMFolderDrivers.ps1
<# .Synopsis SCCM Shipped without a cmdlet to remove packages from a folder! This tool fixes that. .DESCRIPTION Use this tool to delete Packages which are within a folder in SCCM. Simply specify your folder name and site code, and the tool will enumerate the contents of a folder, find the right package ID, t...
PowerShellCorpus/Github/Mayarajan_MVCMovies/MVCMovie/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/Mayarajan_MVCMovies/MVCMovie/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/Mayarajan_MVCMovies/MVCMovie/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/Mayarajan_MVCMovies/MVCMovie/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/Mayarajan_MVCMovies/MVCMovie/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/Mayarajan_MVCMovies/MVCMovie/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/Mayarajan_MVCMovies/MVCMovie/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/Mayarajan_MVCMovies/MVCMovie/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/Mayarajan_MVCMovies/MVCMovie/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/Mayarajan_MVCMovies/MVCMovie/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/Mayarajan_MVCMovies/MVCMovie/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/fiit-pdt_assignment-gis-Bleskino/Mapplikacia/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/fiit-pdt_assignment-gis-Bleskino/Mapplikacia/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/fiit-pdt_assignment-gis-Bleskino/Mapplikacia/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/fiit-pdt_assignment-gis-Bleskino/Mapplikacia/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/fiit-pdt_assignment-gis-Bleskino/Mapplikacia/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/fiit-pdt_assignment-gis-Bleskino/Mapplikacia/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/fiit-pdt_assignment-gis-Bleskino/Mapplikacia/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/fiit-pdt_assignment-gis-Bleskino/Mapplikacia/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/fiit-pdt_assignment-gis-Bleskino/Mapplikacia/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/v-peliao_E2E_Test1qd.eu-es/.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/ncouraud_OMSA-Notify/OMSANotify.ps1
OMSANotify.ps1
<# .SYNOPSIS This is a PowerShell Script to generate email alerts from Dell OpenManage Server Administrator Alerts .DESCRIPTION This Script Is used to send SMTP alerts from Servers running Dell Open Manage Server Administrator. It can automatically configure itself for most common OpenManage Alerts using the -Se...
PowerShellCorpus/Github/HBUHSD_Aeries-API-Examples/Powershell/StudentSearch.ps1
StudentSearch.ps1
# Here is a quick Powershell example of how to use the Aeries API. It searches # for a name in the students of Screaming Eagle High School. # You can replace this code with the cert to your own instance if you want but # please keep it safe. The certificate can expose student information if not # properly secured...
PowerShellCorpus/Github/chaoos-theory_gml/gml.ps1
gml.ps1
# INITIAL PATH $DIRECTORY_INIT_PATH="LDAP://OU=location,DC=company,DC=com" function domain(){ Write-host -ForegroundColor Gray " TRYING TO ESTABLISH CONNECTION WITH AD DOMAIN ..." $DOMAIN = New-Object System.DirectoryServices.DirectoryEntry($DIRECTORY_INIT_PATH) if ( $DOMAIN ){ # SHOW GR...
PowerShellCorpus/Github/zaicnupagadi_DeleteCanceledMeetings.ps1/DeleteCanceledMeetings.ps1
DeleteCanceledMeetings.ps1
<# .SYNOPSIS DeleteCanceledMeetings.ps1 - Cancelled meetings removal script. .PARAMETER SearchStartDay (OPTIONAL) Specifies START date from which sript should start searching of appointments. If not specified the today's date is used. .PARAMETER SearchEndDay (MANDATORY) Specifies END date till which sript ...
PowerShellCorpus/Github/briantist_Idempotion/Idempotion.tests.ps1
Idempotion.tests.ps1
$modulePath = $PSScriptRoot $moduleName = $modulePath | Split-Path -Leaf Describe 'Idempotion Module' -Tags Root { Context "Manifest Destinies" { $Script:manifest = $null It 'has a valid manifest' { { $Script:manifest = Test-ModuleManifest -Path "$modulePath...
PowerShellCorpus/Github/briantist_Idempotion/tester.sample.ps1
tester.sample.ps1
[CmdletBinding()] param( [bool] $ExportAll = $true ) $thisModule = [System.IO.Path]::GetFileName($PSScriptRoot) Set-Variable -Name "__${thisModule}_Export_All" -Value $ExportAll -Force $mod = Import-Module $PSScriptRoot -Force -Verbose -PassThru
PowerShellCorpus/Github/briantist_Idempotion/appveyor.pester.ps1
appveyor.pester.ps1
$modulePath = $PSScriptRoot $moduleName = $modulePath | Split-Path -Leaf $pesterPaths = @( @{ Path = ".\$moduleName.Tests.ps1" } , @{ Path = '.\Private' Parameters = @{} } , @{ Path = '.\Public' Parameters = @{} } ) $pesterPaths | ...
PowerShellCorpus/Github/briantist_Idempotion/Private/New-ParameterBlockFromResourceDefinition.Tests.ps1
New-ParameterBlockFromResourceDefinition.Tests.ps1
param( [System.Management.Automation.PSModuleInfo] $Module = (Import-Module -Name ($PSScriptRoot | Split-Path -Parent) -Force -PassThru -ErrorAction Stop) ) InModuleScope $Module.Name { Describe "New-ParameterBlockFromResourceDefinition" { $ParamExclusions = '*:DependsOn','Gorgon:Ensure','*i...
PowerShellCorpus/Github/briantist_Idempotion/Private/Get-FilteredResourceProperties.Tests.ps1
Get-FilteredResourceProperties.Tests.ps1
param( [System.Management.Automation.PSModuleInfo] $Module = (Import-Module -Name ($PSScriptRoot | Split-Path -Parent) -Force -PassThru -ErrorAction Stop) ) InModuleScope $Module.Name { Describe "Get-FilteredResourceProperties" { $resource = Get-DscResource -Name File $exclusions = ...
PowerShellCorpus/Github/briantist_Idempotion/Private/New-ParameterBlockFromResourceDefinition.ps1
New-ParameterBlockFromResourceDefinition.ps1
function New-ParameterBlockFromResourceDefinition { [CmdletBinding(DefaultParameterSetName = 'AsString')] [OutputType([String], ParameterSetName = 'AsString')] [OutputType([String[]], ParameterSetName = 'AsArray')] param( [Parameter( Mandatory, ValueFromPipeline )] [Microsoft.PowerS...
PowerShellCorpus/Github/briantist_Idempotion/Private/Get-FilteredDefinitions.ps1
Get-FilteredDefinitions.ps1
function Get-FilteredDefinitions { [CmdletBinding()] [OutputType([HashTable])] param( [Parameter( Mandatory )] [HashTable] $CommandDefinition , [Parameter()] [ValidateNotNullOrEmpty()] [SupportsWildcards()] [String[]] $IncludeVerb , [Parameter()] [A...
PowerShellCorpus/Github/briantist_Idempotion/Private/Get-FilteredResourceProperties.ps1
Get-FilteredResourceProperties.ps1
function Get-FilteredResourceProperties { [CmdletBinding()] [OutputType([System.Management.Automation.DscResourcePropertyInfo[]])] param( [Parameter( Mandatory, ValueFromPipeline )] [Microsoft.PowerShell.DesiredStateConfiguration.DscResourceInfo] $Resource , [Parameter( ...
PowerShellCorpus/Github/briantist_Idempotion/Private/New-ParameterFromResourcePropertyInfo.ps1
New-ParameterFromResourcePropertyInfo.ps1
function New-ParameterFromResourcePropertyInfo { [CmdletBinding()] [OutputType([String])] param( [Parameter( Mandatory, ValueFromPipelineByPropertyName )] [ValidateNotNullOrEmpty()] [String] $Name , [Parameter( Mandatory, ValueFromPipelineByProperty...
PowerShellCorpus/Github/briantist_Idempotion/Private/Get-DefaultDefinitions.Tests.ps1
Get-DefaultDefinitions.Tests.ps1
param( [System.Management.Automation.PSModuleInfo] $Module = (Import-Module -Name ($PSScriptRoot | Split-Path -Parent) -Force -PassThru -ErrorAction Stop) ) InModuleScope $Module.Name { Describe "Get-DefaultDefinitions" { $result = Get-DefaultDefinitions It 'returns a hashtable' {...
PowerShellCorpus/Github/briantist_Idempotion/Private/New-ParameterFromResourcePropertyInfo.Tests.ps1
New-ParameterFromResourcePropertyInfo.Tests.ps1
param( [System.Management.Automation.PSModuleInfo] $Module = (Import-Module -Name ($PSScriptRoot | Split-Path -Parent) -Force -PassThru -ErrorAction Stop) ) InModuleScope $Module.Name { Describe "New-ParameterFromResourcePropertyInfo" { $testValidateSet = [PSCustomObject]@{ Name...
PowerShellCorpus/Github/briantist_Idempotion/Private/New-FunctionFromDefinition.Tests.ps1
New-FunctionFromDefinition.Tests.ps1
param( [System.Management.Automation.PSModuleInfo] $Module = (Import-Module -Name ($PSScriptRoot | Split-Path -Parent) -Force -PassThru -ErrorAction Stop) ) InModuleScope $Module.Name { Describe "New-FunctionFromDefinition" { $defs = Get-DefaultDefinitions $dscModule = 'PSDesiredS...
PowerShellCorpus/Github/briantist_Idempotion/Private/New-FunctionFromDefinition.ps1
New-FunctionFromDefinition.ps1
function New-FunctionFromDefinition { [CmdletBinding()] [OutputType([String])] param( [Parameter( Mandatory, ValueFromPipelineByPropertyName )] [ValidateNotNullOrEmpty()] [Alias('Method')] [String] $Verb , [Parameter( Mandatory, ValueFromPipeli...
PowerShellCorpus/Github/briantist_Idempotion/Private/Get-DefaultDefinitions.ps1
Get-DefaultDefinitions.ps1
function Get-DefaultDefinitions { [CmdletBinding()] [OutputType([HashTable])] param() $definitionPath = $MyInvocation.MyCommand.Module.ModuleBase | Join-Path -ChildPath $MyInvocation.MyCommand.Module.PrivateData.IdempotionConfig.CommandDefinitions Import-PowerShellDataFile -LiteralPath $definitionPat...
PowerShellCorpus/Github/briantist_Idempotion/Private/Get-FilteredDefinitions.Tests.ps1
Get-FilteredDefinitions.Tests.ps1
param( [System.Management.Automation.PSModuleInfo] $Module = (Import-Module -Name ($PSScriptRoot | Split-Path -Parent) -Force -PassThru -ErrorAction Stop) ) InModuleScope $Module.Name { Describe "Get-FilteredDefinitions" { $hashMatch = {param([HashTable]$cur, [HashTable]$orig) $...
PowerShellCorpus/Github/briantist_Idempotion/Public/Convert-DscResourceToCommand.ps1
Convert-DscResourceToCommand.ps1
function Convert-DscResourceToCommand { [CmdletBinding(DefaultParameterSetName = 'Module')] [OutputType([System.Management.Automation.PSModuleInfo], ParameterSetName = 'Module')] [OutputType([System.Management.Automation.PSModuleInfo], ParameterSetName = 'Module-Import')] [OutputType([System.Management.Automation.P...
PowerShellCorpus/Github/briantist_Idempotion/Public/Convert-DscResourceToCommand.Tests.ps1
Convert-DscResourceToCommand.Tests.ps1
param( [System.Management.Automation.PSModuleInfo] $Module = (Import-Module -Name ($PSScriptRoot | Split-Path -Parent) -Force -PassThru -ErrorAction Stop) ) Describe "Convert-DscResourceToCommand" { It "does something useful" -Pending { $true | Should Be $false } }
PowerShellCorpus/Github/briantist_Idempotion/Classes/ResourcePropertyPattern.Class.ps1
ResourcePropertyPattern.Class.ps1
Class ResourcePropertyPattern { [String]$ResourcePattern [String]$PropertyPattern ResourcePropertyPattern([String]$ResourcePattern, [String]$PropertyPattern) { $this.ResourcePattern = $ResourcePattern $this.PropertyPattern = $PropertyPattern } ResourcePropertyPattern...
PowerShellCorpus/Github/tescales_devDesktop/installChoco.ps1
installChoco.ps1
Configuration InstallChoco { Import-DscResource -Module cChoco Node "localhost" { cChocoInstaller InstallChoco { InstallDir = "c:\choco" } } } $config = InstallChoco Start-DscConfiguration -Path $config.psparentpath -Wait -Verbose -Force
PowerShellCorpus/Github/nmbradford_public/powercli/autodeploy/update_imageprofile.ps1
update_imageprofile.ps1
#update_imageprofile.ps1 # updates an existing imageprofile with vibs available in new imgaes as released by VMware # while still retaining custom vibs such as vcd agent, fdm agent, drivers and the n1k vem. # # Nick Bradford - nick.m.bradford@accenture.com # # v0.1 16/06/12 trap [Exception] { Writ...
PowerShellCorpus/Github/tomellis91_Database-Backup-and-Delete/DatabaseDeletion.ps1
DatabaseDeletion.ps1
########################################################################## #SQL query to list db names - DONE #return sql results - Returning the results within the array Param( [string]$ServerIp = '.', [string]$userName = 'sa', [string]$scriptPath = (Get-Item -Path ".\" -Verbose).FullName, [stri...
PowerShellCorpus/Github/doubleflying_myspace/doublefly/packages/Microsoft.AspNet.Providers.LocalDB.1.1/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) try { # Set up variables $timestamp = (Get-Date).ToString('yyyyMMddHHmmss') $projectName = [IO.Path]::GetFileName($project.ProjectName.Trim([IO.PATH]::DirectorySeparatorChar, [IO.PATH]::AltDirectorySeparatorChar)) $catalogName = "aspnet-$project...
PowerShellCorpus/Github/doubleflying_myspace/doublefly/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/doubleflying_myspace/doublefly/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/doubleflying_myspace/doublefly/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/doubleflying_myspace/doublefly/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/doubleflying_myspace/doublefly/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/doubleflying_myspace/doublefly/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/doubleflying_myspace/doublefly/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/doubleflying_myspace/doublefly/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/doubleflying_myspace/doublefly/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/doubleflying_myspace/doublefly/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/doubleflying_myspace/doublefly/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/MrNetic_IaC/IaC.ps1
IaC.ps1
#Infrasctrure as code #Script Path $ScriptPath = Split-Path $MyInvocation.InvocationName #Handle flow flag [bool] $controlFlag =1 # DebugFlag for a more verbose output [bool] $debugFlag=1 # Variables [string] $OptionEnvironment=9999 #ExitCode #Question number 1, where are you touching? do ...
PowerShellCorpus/Github/MrNetic_IaC/Modules/Azure/Actions/ManageAzureAccount.ps1
ManageAzureAccount.ps1
PowerShellCorpus/Github/MrNetic_IaC/Modules/Azure/Actions/Action.ps1
Action.ps1
#Functions Zone function Show-Menu { param ( [string]$Title = 'Menu' ) Clear-Host Write-Host "================ $Title ================" Write-Host '1: Press 1 to manage your azure account' Write-Host '2: Press 2 to manage VMs' Write-Host '3: Press 3 to manage storage'...
PowerShellCorpus/Github/MrNetic_IaC/Modules/Azure/Actions/GetSubscriptions.ps1
GetSubscriptions.ps1
#Login param ( [Parameter(Mandatory=$false)][string]$DebugFlag ) IF ($DebugFlag -eq "true") { $StartDate=get-date write-host 'Executing Authentication Module>>' $MyInvocation.MyCommand.Name '<< at UTC' $StartDate.ToUniversalTime() 'with the configuration bellow:' ` -foregroundcolor "DarkBlue" -ba...
PowerShellCorpus/Github/MrNetic_IaC/Modules/Azure/Authentication/Login.ps1
Login.ps1
#Login $StartDate=get-date write-host 'Executing Authentication Module>>' $MyInvocation.MyCommand.Name '<< at UTC' $StartDate.ToUniversalTime() 'with the configuration bellow:' ` -foregroundcolor "DarkBlue" -backgroundcolor "gray" try { Login-AzureRmAccount } catch { Write-Output "There was an ex...
PowerShellCorpus/Github/MrNetic_IaC/Modules/Menu/Main.ps1
Main.ps1
#Functions Zone function Show-Menu { param ( [string]$Title = 'Menu' ) Clear-Host Write-Host "================ $Title ================" Write-Host '1: Press 1 for Azure' Write-Host '2: Press 2 for Aws' Write-Host '3: Press 3 for Gcompute' Write-Host '4: Press 4 f...
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/5_1_CreateWestCentralUsDC03.ps1
5_1_CreateWestCentralUsDC03.ps1
#Create VMs #Administrative Account to be locally created on the servers: $cred = Get-Credential $rgName = 'rgInfrastructure02' $location = 'WestCentralUs' $asName='asDomainControllers02' $vmSize ="Standard_A0" $machineName="DC03" $vnetName= "VnetProductionWestCentralUS" $subnetName="subnetDCWestCentr...
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/3_1_CreateWestEuropeDC01.ps1
3_1_CreateWestEuropeDC01.ps1
#Create VMs #Administrative Account to be locally created on the servers: $cred = Get-Credential $rgName = 'rgInfrastructure01' $location = 'WestEurope' $asName='asDomainControllers01' $vmSize ="Standard_A0" $machineName="DC01" $vnetName= "VnetProductionWestEurope" $subnetName="subnetDCWestEurope" $i...
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/3_9_CreateS2DandSOFS_ClusterWestEurope.ps1
3_9_CreateS2DandSOFS_ClusterWestEurope.ps1
#Run the following on each sql server Add-Computer -DomainName Azuring.local -Credential pcondeca Restart-Computer -force #install failover clustering and File share role Install-WindowsFeature –Name Failover-Clustering,File-Services,FS-FileServer –IncludeManagementTools #Create Cluster New-Cluster -Name We...
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/8_4_ConfigureInternalLoadBalancerForSQLFCIWestCentralUs.ps1
8_4_ConfigureInternalLoadBalancerForSQLFCIWestCentralUs.ps1
#View Resouces Get-ClusterResource $ClusterNetworkName = "Cluster Network 3" # the cluster network name (Use Get-ClusterNetwork on Windows Server 2012 of higher to find the name). $IPResourceName = "SQL IP Address 3 (WCUSQL01)" # the IP Address cluster resource name. $ILBIP = "10.10.112.19" # the IP Address of the ...
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/8_3_InstallSQLServer_WestCentralUs.ps1
8_3_InstallSQLServer_WestCentralUs.ps1
#bla bla bla
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/10_Add2NodesToGeoCluster.ps1
10_Add2NodesToGeoCluster.ps1
#Run the following on each sql server at the West Central US Add-Computer -DomainName Azuring.local -Credential pcondeca Restart-Computer -force #install failover clustering and File share role Install-WindowsFeature –Name Failover-Clustering,File-Services –IncludeManagementTools Get-Cluster WestEuropeSQLClust...
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/7_2_CreateS2DandSOFS_ClusterWestCentralUs.ps1
7_2_CreateS2DandSOFS_ClusterWestCentralUs.ps1
#Run the following on each sql server Add-Computer -DomainName Azuring.local -Credential pcondeca Restart-Computer -force #install failover clustering and File share role Install-WindowsFeature –Name Failover-Clustering,File-Services,FS-FileServer –IncludeManagementTools #Create Cluster New-Cluster -Name We...
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/6_AddBackendNicsForSQLServerWestCentralUs.ps1
6_AddBackendNicsForSQLServerWestCentralUs.ps1
#For SQL03 $machineName="SQL03" $rgName = 'rgInfrastructure02' $asName='asSQLServer02' $location = 'WestCentralUs' $vnetName= "VnetProductionWestCentralUs" $subnetName="subnetSQLBackendWestCentralUs" $ipAddress ="10.10.113.11" #VM WILL BE STOPPED Stop-AzureRmVM -Name $machineName -ResourceGroupName $rgNam...