full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/williamjacksn_chocolatey_packages/pidgin/tools/ChocolateyInstall.ps1 | ChocolateyInstall.ps1 | $package_name = 'Pidgin'
$file_type = 'exe'
$silent_args = '/S'
$url = 'http://sourceforge.net/projects/pidgin/files/Pidgin/2.10.11/pidgin-2.10.11-offline.exe'
Stop-Process -ProcessName pidgin*
Install-ChocolateyPackage $package_name $file_type $silent_args $url
|
PowerShellCorpus/Github/janusz96_semestrIV/platformyTechnologiczne/labc/lab5/Lab5/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/janusz96_semestrIV/platformyTechnologiczne/labc/lab5/Lab5/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/janusz96_semestrIV/platformyTechnologiczne/labc/lab4/Lab4/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/janusz96_semestrIV/platformyTechnologiczne/labc/lab4/Lab4/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/dlwyatt_TestProject/test.Tests.ps1 | test.Tests.ps1 | Describe 'Test' {
It 'Succeeds' {
$true | Should Be $true
}
It 'Fails' {
$true | Should Be $false
}
It 'Marks an empty test as pending' {
}
It 'Marks a tagged test as pending' -Pending {
$true | Should Be $false
}
It 'Marks a tagg... |
PowerShellCorpus/Github/naoey_repack-osz/repack-osz.ps1 | repack-osz.ps1 | param (
[Parameter(Mandatory=$true)][string]$source,
[Parameter(Mandatory=$true)][string]$destination
)
$sources = Get-ChildItem -Path $source -Directory
Add-Type -assembly "system.io.compression.filesystem"
Foreach ($s in $sources)
{
$finalDestination = Join-path -path $destination -ChildPath "$($s... |
PowerShellCorpus/Github/rackerlabs_Invoke-RsCloudOfficeRequest/New-Release.ps1 | New-Release.ps1 | function Main {
$module = Test-ModuleManifest .\RackspaceCloudOffice.psd1
[string] $version = $module.Version
$d = New-TemporaryDirectory
try {
$moduleDir = New-Item -ItemType Directory -Path (Join-Path $d $module.Name)
Copy-Item *.psd1 $moduleDir
Copy-Item *.psm1 $modul... |
PowerShellCorpus/Github/bottcompass_misc/Examples-WindowsUpdate.ps1 | Examples-WindowsUpdate.ps1 | $servers = get-adcomputer -filter 'OperatingSystem -like "*server*"' | select Name
foreach ( $server in $servers )
{
$serverName = $server.Name
if ( test-connection -computername $serverName -quiet -delay 1 -count 1 )
{
Start-Job -Name "Job-$serverName" -ArgumentList $serverName -ScriptBlo... |
PowerShellCorpus/Github/bottcompass_misc/Examples-jobs.ps1 | Examples-jobs.ps1 | $servers = get-adcomputer -filter * -Properties * | ? { $_.OperatingSystem -like '*server*' }
foreach ( $server in $servers )
{
$serverName = $server.DNSHostName
Start-Job -ArgumentList $serverName -ScriptBlock {
$test = Test-Connection -Quiet -count 1 -Delay 1 -ComputerName $args[0]
if($tes... |
PowerShellCorpus/Github/mrsamuelbarnes_Countdown-Timer/Countdown-Timer.ps1 | Countdown-Timer.ps1 | # Title
$host.ui.RawUI.WindowTitle = "Countdown"
# The name of the thing you are counting down for
$countdownName = "2017"
# Create the countdown time
$countdownTime = Get-Date "01/01/2017 0:00 AM"
# Main program loop
while($true){
# Get the current datetime
$currentDateTime = Get-Date
# Calculat... |
PowerShellCorpus/Github/elliot_vmware-powercli-snippets/Snippets/Enable Host Lockdown.ps1 | Enable Host Lockdown.ps1 | (Get-VMHost "dc1-vm-01" | Get-View).EnterLockdownMode() | Get-VMHost | Select Name,@{N="LockDown"; E={$_.Extensiondata.Config.adminDisabled}} | FT -auto Name LockDown |
PowerShellCorpus/Github/elliot_vmware-powercli-snippets/Snippets/Remove Port Group from vSwitches.ps1 | Remove Port Group from vSwitches.ps1 | None |
PowerShellCorpus/Github/elliot_vmware-powercli-snippets/Snippets/SSH Disable.ps1 | SSH Disable.ps1 | Connect-VIServer vCenter01
Get-Cluster | Get-VMHost | ForEach { Stop-VMHostService -HostService ($_ | Get-VMHostService | Where {$_.Key -eq "TSM-SSH" }) -Confirm:$FALSE } |
PowerShellCorpus/Github/elliot_vmware-powercli-snippets/Snippets/VMotion Folder to Datastore.ps1.ps1 | VMotion Folder to Datastore.ps1.ps1 | #
# Example:
# & '.\VMotion Folder to Datastore.ps1' -Folder "Web Servers" -Datastore "SAS-R6-D1"
#
param (
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[string]
$Folder,
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[string]
$Datastore
)
Connect-VIServer -Se... |
PowerShellCorpus/Github/elliot_vmware-powercli-snippets/Snippets/Disable Host Lockdown.ps1 | Disable Host Lockdown.ps1 | (Get-VMHost "dc1-vm-01" | Get-View).ExitLockdownMode() |
PowerShellCorpus/Github/elliot_vmware-powercli-snippets/Snippets/Shutdown Host VMs.ps1 | Shutdown Host VMs.ps1 | #
# Example:
# & '.\Shutdown Host VMs.ps1' -Hostname dc1-esxi01
#
param (
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[string]
$Hostname
)
$Credential = Get-Credential
Connect-VIServer -Server $Hostname -Credential $Credential
Get-VM | % {
Shutdown-VMGuest -VM $_ -Confir... |
PowerShellCorpus/Github/elliot_vmware-powercli-snippets/Snippets/Bulk Datastore Migration.ps1 | Bulk Datastore Migration.ps1 | None |
PowerShellCorpus/Github/elliot_vmware-powercli-snippets/Snippets/Rescan Datastores.ps1 | Rescan Datastores.ps1 | #
# Example:
# & '.\Rescan Datastores.ps1' -Cluster DC1
#
param (
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[string]
$Cluster
)
Connect-VIServer "vCenter01"
Get-Cluster $Cluster | Get-VMHost | Get-VMHostStorage -RescanAllHba -RescanVmfs |
PowerShellCorpus/Github/elliot_vmware-powercli-snippets/Snippets/Find Host By MAC.ps1 | Find Host By MAC.ps1 | #
# Example:
# & '.\Find Host By MAC.ps1' -MAC 00:00:00:00:00
#
param (
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[string]
$MAC
)
Connect-VIServer -Server vCenter01
Get-VMHost | Get-VMHostNetworkAdapter | Where-Object {$_.Mac -eq $MAC} | Format-List -Property *
|
PowerShellCorpus/Github/elliot_vmware-powercli-snippets/Snippets/List VMs for Datastore.ps1 | List VMs for Datastore.ps1 | #
# Example:
# & '.\List VMs for Datastore.ps1' -Datastore SAS-R6-D1
#
param (
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[string]
$Datastore
)
Connect-VIServer vCenter01
($DS = Get-Datastore $Datastore) | % {
$_ | Get-VM | % {
$_ | Select @{N="VMname";E={$_.Name}},... |
PowerShellCorpus/Github/elliot_vmware-powercli-snippets/Snippets/SSH Enable.ps1 | SSH Enable.ps1 | Connect-VIServer vCenter01
Get-Cluster "Current" | Get-VMHost | ForEach { Start-VMHostService -HostService ($_ | Get-VMHostService | Where {$_.Key -eq "TSM-SSH" }) -Confirm:$FALSE } |
PowerShellCorpus/Github/mikeehsu_PsArmResources/examples/FirstVirtual.tests.ps1 | FirstVirtual.tests.ps1 | <#
Invoke-Pester -Test MyRG
#>
Import-Module "PsArmPester" -Force
$ResourceGroupName = 'MyRG'
$DeployScriptName = 'FirstVirtualDRY.ps1'
# next line finds the deploy script relative to this test script:
$DeployScript = Join-Path ($PSCommandPath | Split-Path -Parent) $DeployScriptName
# Set up test case... |
PowerShellCorpus/Github/mikeehsu_PsArmResources/examples/VnetStorageVmNic.ps1 | VnetStorageVmNic.ps1 | Import-Module "PsArmResources" -Force
## Global
$ResourceGroupName = "ResourceGroup11"
$Location = "usgoviowa"
$UserName = "User"
$Password = "Password"
## Storage
$StorageName = "GeneralStorage6cc"
$StorageTier = "Standard"
$StorageReplication = "GRS"
## Network
$InterfaceName = "ServerInterface06"
$... |
PowerShellCorpus/Github/mikeehsu_PsArmResources/examples/PsArmQuickVMExample.ps1 | PsArmQuickVMExample.ps1 |
$location = 'usgovvirginia'
$ResourceGroupName = 'LiveVnet'
$lbVnetResourceGroupName = 'LiveVnet'
$lbVnetName = 'LiveVnet'
$lbSubnetName = 'SecuritySubnet'
$availabilitySetName = 'FirewallLiveVnet'
$template = New-PsArmTemplate
$template.resources += New-PsArmAvailabilitySet -Name $AvailabilitySetName -Loc... |
PowerShellCorpus/Github/mikeehsu_PsArmResources/examples/FirstVirtualDRY.ps1 | FirstVirtualDRY.ps1 | # A DRY version of FirstVirtual.ps1
param(
[switch] $RunIt,
[string] $Path
)
Import-Module "PsArmResources" -Force
Set-StrictMode -Version latest
$ErrorActionPreference = "Stop"
function New-StandardVM() {
[CmdletBinding()]
Param (
[parameter(Mandatory=$False)] [string] $VMName = "MyVM",... |
PowerShellCorpus/Github/mikeehsu_PsArmResources/examples/FirstVirtual.ps1 | FirstVirtual.ps1 | <#
This is the PsArmResource equivalent to the tutorial,
"Create your first virtual network" at
https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-get-started-vnet-subnet
#>
param(
[switch] $RunIt,
[string] $Path
)
Import-Module "PsArmResources" -Force
Set-StrictMode -Version latest
... |
PowerShellCorpus/Github/mikeehsu_PsArmResources/examples/VnetNsgPipGateway.ps1 | VnetNsgPipGateway.ps1 | Import-Module "PsArmResources" -Force
$ResourceGroupName = 'MyVnet'
$deploymentName = $resourceGroupName + $(get-date -f yyyyMMddHHmmss)
$deploymentFile = $env:TEMP + '\'+ $deploymentName + '.json'
$template = New-PsArmTemplate
$template.resources += New-PsArmNetworkSecurityGroup -Name "DefaultNsg" |
Ad... |
PowerShellCorpus/Github/v-peliao_E2E_NewRepo_1489714352737/.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/morganwm_PowerShellStuff/Git_SetReset_UserInfo_WithPopUpForm_2.ps1 | Git_SetReset_UserInfo_WithPopUpForm_2.ps1 | [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
#Git Function
function Set-UserInfo ( [string] $N, [string] $E) {
git config --global --unset user.name
git config --global --unset user.email
... |
PowerShellCorpus/Github/morganwm_PowerShellStuff/ValidateCredentialsActiveDirectory_Form.ps1 | ValidateCredentialsActiveDirectory_Form.ps1 | Add-Type -AssemblyName System.DirectoryServices.AccountManagement
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
$Domain = $env:USERDOMAIN
$ct = [System.DirectoryServices.AccountManagement.ContextType... |
PowerShellCorpus/Github/morganwm_PowerShellStuff/TFStoGIT_V1.ps1 | TFStoGIT_V1.ps1 | $Path = "C:\Git"
cd $Path
#For each top level folder copy in the .gitignore file
$Repos = ls -Directory .\
$Repos | ForEach-Object{
Copy-Item -Path .\.gitignore -Destination .\$($_.name)\.gitignore -Force
}
#remove all the TFVC link files
$ChangesetFileNames = ls -Path .\ -Recurse -Include "*.vs*scc"
$... |
PowerShellCorpus/Github/morganwm_PowerShellStuff/GitUserInfo.ps1 | GitUserInfo.ps1 | [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
#Git Function
function Set-UserInfo ( [string] $N, [string] $E) {
git config --global --unset user.name
git config --global --unset user.email
... |
PowerShellCorpus/Github/morganwm_PowerShellStuff/ValidateCredentialsActiveDirectory.ps1 | ValidateCredentialsActiveDirectory.ps1 | Add-Type -AssemblyName System.DirectoryServices.AccountManagement
$UserName= "SDIRROBOTICSTFS"
$Password=''
$Domain = $env:USERDOMAIN
$ct = [System.DirectoryServices.AccountManagement.ContextType]::Domain
$pc = New-Object System.DirectoryServices.AccountManagement.PrincipalContext $ct,$Domain
$pc.ValidateCr... |
PowerShellCorpus/Github/morganwm_PowerShellStuff/FilmGenomeTensileAutomatedBuildScript.ps1 | FilmGenomeTensileAutomatedBuildScript.ps1 | #Add-Type -AssemblyName System.DirectoryServices.AccountManagement
#get credentials from user for later use
#$creds = Get-Credential -UserName "SDIRROBOTICSTFS" -Message "Please Enter a Username and Password for Authentication to TFS 2017"
#validate credentials against active directory to ensure they ... |
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_Provision_2017_6_2_8_58_36/.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/jbruett_dsc-domain/userdata.ps1 | userdata.ps1 | $Timestamp = Get-date -f yyyy_MM_dd-hh-mm-ss
Start-Transcript -Path C:\Userdata_$Timestamp.txt
#Move required modules into PSModulePath
Move-Item 'C:\Windows\Temp\xActiveDirectory', 'C:\Windows\Temp\xPSDesiredStateConfiguration', 'C:\Windows\Temp\xTimeZone', 'C:\Windows\Temp\xNetworking', 'C:\Windows\Temp\xCompute... |
PowerShellCorpus/Github/jbruett_dsc-domain/NewDomain/NewDomain.ps1 | NewDomain.ps1 | configuration NewDomain {
param
(
# PSCredential for Safe Mode Administrator Password (password only)
[parameter(Mandatory)]
[pscredential]$SafeModeAdministratorCred,
# PSCredential for the domain administrator (password only)
[Parameter(Mandatory)]
[pscre... |
PowerShellCorpus/Github/jbruett_dsc-domain/AppVeyor/Install.ps1 | Install.ps1 | #Install the Nuget Package Provider to work with the PSGallery.
Install-PackageProvider Nuget -ForceBootstrap -Force
#Ensure the Repository is trusted.
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
#Install Any modules we need for our DSC Configuration and/or testing.
Install-Module Pester, PsSc... |
PowerShellCorpus/Github/jbruett_dsc-domain/AppVeyor/AfterTests.ps1 | AfterTests.ps1 | #Import the Configuration Script
Import-Module '.\NewDomain\NewDomain.ps1'
#Call The Configuration Script passing in our Configuration Data
Main -OutputPath $ProjectRoot -ConfigurationData '.\NewDomain\ConfigurationData.psd1'
#Create a Zip from the Mof output (Include Modules)
Get-Item -Path "$ProjectRoot\user... |
PowerShellCorpus/Github/jbruett_dsc-domain/Tests/linting.ps1 | linting.ps1 | $ErrorActionPreference = 'Stop'
$Modules = Get-ChildItem .\NewDomain\ -Filter '*.ps1' -Recurse -Exclude 'Install.ps1'
$Rules = Get-ScriptAnalyzerRule
Describe "Linting all .ps1 files" {
foreach ($module in $modules) {
Context "Testing Module | $($module.BaseName) for Standard Processing" {
... |
PowerShellCorpus/Github/jbruett_dsc-domain/Tests/appveyor.pester.ps1 | appveyor.pester.ps1 | # This script will invoke pester tests
# It should invoke on PowerShell v2 and later
# We serialize XML results and pull them in appveyor.yml
#If Finalize is specified, we collect XML output, upload tests, and indicate build errors
param(
[switch]$Finalize,
[switch]$Test,
[string]$ProjectRoot = $EN... |
PowerShellCorpus/Github/majst32_SummitPKI/FIleAclsConfig.ps1 | FIleAclsConfig.ps1 | Configuration Test {
import-dscresource -ModuleName "mACLs" -moduleversion "1.0.0.0"
Node EntRoot {
FileACLs test{
Path = "C:\PKI"
IdentityReference = "Company\Cert Publishers"
FileSystemRights = 'Read'
AccessControlType = 'Allow'
... |
PowerShellCorpus/Github/majst32_SummitPKI/macls manifest.ps1 | macls manifest.ps1 | $Params = @{
Path = 'C:\Program Files\WindowsPowerShell\Modules\mACLs\0.0.0.1\mACLs.psd1'
Author = 'Missy Januszko'
ModuleVersion = '0.0.0.1'
}
New-ModuleManifest @Params -Guid (new-guid) -DscResourcesToExport FileACLs |
PowerShellCorpus/Github/majst32_SummitPKI/PKIDeploy.ps1 | PKIDeploy.ps1 | Configuration PKIDeploy {
Import-DSCresource -ModuleName PSDesiredStateConfiguration,
@{ModuleName="xADCSDeployment";ModuleVersion="1.1.0.0"},
@{ModuleName="xSMBShare";ModuleVersion="2.0.0.0"},
@{ModuleName="xDNSServer";ModuleVersion="1.7.0.0"},
@{ModuleNam... |
PowerShellCorpus/Github/majst32_SummitPKI/Demo.ps1 | Demo.ps1 | #Landscape
#OLRoot - "offline", non-domain-joined
#ENTSub - domain-joined subordinate CA
#DC1 - domain controller
$OLRoot = "olroot.company.pri"
$Entsub = "EntSub"
$DC = "DC1"
#The build:
#https://technet.microsoft.com/en-us/library/hh831348(v=ws.11).aspx
#Need DNS or HostFile entry for OLRoot.
Install-... |
PowerShellCorpus/Github/rrg92_CacheManager/Send-SQL2Zabbix.cmdlet.ps1 | Send-SQL2Zabbix.cmdlet.ps1 | Function Send-SQL2Zabbix {
[CmdLetBinding(SupportsShouldProcess=$True)]
param(
#This is instance name! You can specify IP, ServerName\Instance, etc.
[string]$Instance
,#This are the Keys Definitions. The Keys Definitions are a powershell hashtable.
#It defines which items will be send to server an... |
PowerShellCorpus/Github/rrg92_CacheManager/modules/XLogging/cmdlets/LogObject.cmdlet.ps1 | LogObject.cmdlet.ps1 | Function New-LogObject {
[CmdLetBinding(SupportsShouldProcess=$True)]
param(
$ServerInstance = ""
)
return (GetLogObject);
<#
.SYNOPSIS
Create a new Log object.
.DESCRIPTION
The CustomMSSQL module provides a log facility, that allows cmdlets share a common mechanism to logging.
... |
PowerShellCorpus/Github/rrg92_CacheManager/modules/XLogging/cmdlets/Test-LogObject.cmdlet.ps1 | Test-LogObject.cmdlet.ps1 | Function Test-LogObject {
[CmdLetBinding()]
param($Path = $null
,[switch]$Screen = $false
,[switch]$Buffer = $false
,$LogLevel = 3
,$LoggingNumber = 15
,$BufferIsHostDelay = 1
,[switch]$BufferIsHost = $false
,[string[]]$RandomColoring=$null
,$RetainedInterval = 1
,$RetainedCount... |
PowerShellCorpus/Github/rrg92_CacheManager/modules/XLogging/helpers/Changelog.aux.ps1 | Changelog.aux.ps1 | #This file will provide functions to manage and interpret changelog...
#This read the changelog.md and finds all versions in file.
#The version is in format ## X.Y.Z - (DATE)
#The return will be be this object with following properties:
#Version: The version string
#Date: the date of version
Function GetVer... |
PowerShellCorpus/Github/rrg92_CacheManager/modules/XLogging/helpers/Metada.aux.ps1 | Metada.aux.ps1 | #GMV is global module values.
#This contains lot of values that can be shared with programmers of this module.
#Check about_Custom_MSSQL to detailed informations.
Function GetGMV {
return $GMV;
}
#Return a GMV VAR SLOT!
#A GMV VAR SLOT is a simply entri o GMV "VARS" key. The "VARS" entry on GMV contains... |
PowerShellCorpus/Github/rrg92_CacheManager/modules/XLogging/helpers/ErrorHandling.aux.ps1 | ErrorHandling.aux.ps1 | Function FormatSQLErrors {
param([System.Exception]$Exception, $SQLErrorPrefix = "MSSQL_ERROR:")
if(!$Exception){
throw "INVALID_EXCEPTION_FOR_FORMATTING"
}
$ALLErrors = @();
$bex = $Exception.GetBaseException();
if($bex.Errors)
{
$Exception.GetBaseException().Errors | %{
$ALLErrors += ... |
PowerShellCorpus/Github/rrg92_CacheManager/modules/XLogging/helpers/Log.aux.ps1 | Log.aux.ps1 | <#
Log allow you use logging facilities in your scripts.
This is standard logging script for use across CustomMSSQL module.
It is implemented basically by GetLogObject functions, that returns a object for use its features.
For help about this functions, check about_LoggingCustomMSSQL help.
#>
Function Ge... |
PowerShellCorpus/Github/rrg92_CacheManager/modules/XLogging/helpers/Dependencies.aux.ps1 | Dependencies.aux.ps1 | |
PowerShellCorpus/Github/rrg92_CacheManager/modules/XLogging/helpers/StringAndPaths.aux.ps1 | StringAndPaths.aux.ps1 | Function Right($str,$qtd = 1){
return $str.substring($str.length - $qtd, $qtd)
}
Function PutFolderSlash($folder, [switch]$Slash = $false ){
if(!$folder){return $null}
$slashToUse = '\'
$slashToReplace = '/'
if($Slash){
$slashToUse = '/'
$slashToReplace = '\'
}
write-verbose "Current folde... |
PowerShellCorpus/Github/rrg92_CacheManager/modules/XLogging/helpers/Files.aux.ps1 | Files.aux.ps1 | #Check if a file can be accessed by specific lock type.
#You can test for S, or X.
#Based on http://stackoverflow.com/questions/876473/is-there-a-way-to-check-if-a-file-is-in-use
Function GetFileLockStatus {
param($FileName,$AccessType = "X",[switch]$KeepOpen=$false)
$r = New-Object PSObject -Prop @{
... |
PowerShellCorpus/Github/anders-r-lindell_CI/CILab/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/anders-r-lindell_CI/CILab/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/anders-r-lindell_CI/CILab/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/anders-r-lindell_CI/CILab/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/anders-r-lindell_CI/CILab/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/anders-r-lindell_CI/CILab/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/anders-r-lindell_CI/CILab/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/anders-r-lindell_CI/CILab/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/anders-r-lindell_CI/CILab/packages/WebGrease.1.5.2/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
# Visual Studio execution done via NuGet Package Manager
Function VSExecution($toolsPath, $project)
{
$project.DTE.ExecuteCommand("File.SaveAll", [system.string]::Empty)
# Get the msbuild version of the project and add the import
$msbuild = [Microsof... |
PowerShellCorpus/Github/anders-r-lindell_CI/CILab/packages/WebGrease.1.5.2/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
# Return a relative path with reference to root as Uri object
# $rootPath - root path
# $relativePath - relative path
# $appendToRelativePath - Optional parameter. If provided will be appended to relative Path using Path.Combine()
Function GetRelativeUri($root... |
PowerShellCorpus/Github/anders-r-lindell_CI/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/anders-r-lindell_CI/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/anders-r-lindell_CI/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/anders-r-lindell_CI/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/anders-r-lindell_CI/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/anders-r-lindell_CI/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/anders-r-lindell_CI/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/anders-r-lindell_CI/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/Appdynamics_DiskSpaceAlertExtension/check_disk.ps1 | check_disk.ps1 |
# Load library for Url encoding
Add-Type -AssemblyName System.Web
# Read in configuration properties
$config = Get-Content "check_disk.cfg"
# Bag of properties passed in the config file
$properties = @{}
# Read in the properties
$config |% `
{
[array]$line = $_ -split '='
if ($line.C... |
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_Provision_2017_4_28_22_59_11/.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/philippdolder_generic-build/create-packages.ps1 | create-packages.ps1 | param([string] $version="1.0.0")
nuget pack $PSScriptRoot\philippdolder.Development\philippdolder.Development.nuspec -version $version
nuget pack $PSScriptRoot\philippdolder.Development.Analyzers\philippdolder.Development.Analyzers.nuspec -version $version
nuget pack $PSScriptRoot\philippdolder.Development.Product... |
PowerShellCorpus/Github/bennyboy23_my-first-MVC/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/geoffritchey_CreateUsers/CreateUser.ps1 | CreateUser.ps1 | ################################
# LCU Create AD User
# CreateUser.ps1
################################
###### **** CONFIG **** ######
#Set-Location -Path C:\Users\Administrator.LCUNET\Desktop\Scripts\LCU
Set-Location -Path $PSScriptRoot
# SQL Server & Instance
$AppProps = convertfrom-stringdata (get-con... |
PowerShellCorpus/Github/VillainyStudios_utility-scripts/data/menu.ps1 | menu.ps1 | # Menu
$run = 1
$choice = ""
while ($run -eq 1) {
while (($choice -ne (1..10)) -and $choice -ne "q") {
cls
'Welcome'
''
'Please choose an option below'
'-----------------------------'
''
'1. Task Manager Toggler'
'2. Clipboard Logger'... |
PowerShellCorpus/Github/VillainyStudios_utility-scripts/data/Toggler.ps1 | Toggler.ps1 | ######################################################################################
# Task Manager Toggler written by:
# Joshua "MrSchism" Embrey [mrschism@sdf.org]
# Joseph "Arcarna" Preston [jpreston86@gmail.com]
# Intial commit: February 5, 2014
# Current version: February 12,... |
PowerShellCorpus/Github/VillainyStudios_utility-scripts/data/DLSorter.ps1 | DLSorter.ps1 | ######################################################################################
# Download sorter written by:
# Joshua "MrSchism" Embrey [mrschism@sdf.org]
# Joseph "Arcarna" Preston [jpreston86@gmail.com]
# Intial commit: April 9, 2014(20140409)
# Current version: June 4, 2014(20140604)
#
# Purpose:... |
PowerShellCorpus/Github/VillainyStudios_utility-scripts/data/kamikaze.ps1 | kamikaze.ps1 | # Kamikaze powershell forkbomb
# Do not use; purely for educational purposes.
while ($true) {
foreach ($i in gps) {
Invoke-item "$pshome\powershell.exe"
}
}
|
PowerShellCorpus/Github/VillainyStudios_utility-scripts/data/Scraper.ps1 | Scraper.ps1 | ######################################################################################
# File Scraper written by:
# Joshua "MrSchism" Embrey [mrschism@sdf.org]
# Joseph "Arcarna" Preston [jpreston86@gmail.com]
# Intial commit: February 10, 2014 (20140210)
# Current version: April 9, 2014(20140409)
#
# Purpo... |
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_Provision_2017_4_8_22_5_20/.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/siglar_Tilgangssjefen/Tilganssjefen_v01.ps1 | Tilganssjefen_v01.ps1 | #PowerShell.exe -windowstyle hidden {
#ERASE ALL THIS AND PUT XAML BELOW between the @" "@
$inputXML = @"
<Window x:Class="Tabbed.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.m... |
PowerShellCorpus/Github/JonCubed_packer-windows-samples/src/packer-windows-aws-base/packer-bootstrap.ps1 | packer-bootstrap.ps1 | <powershell>
function Set-WinRMProperty
{
param([String] $Path, [string] $PropertyName, [string] $Value)
$winRmPath = "winrm/config"
if ($Path)
{
$winRmPath = $winRmPath, $Path -join "/"
}
Start-Process -FilePath winrm `
-ArgumentList "set $winRmPath @... |
PowerShellCorpus/Github/JonCubed_packer-windows-samples/src/packer-windows-aws-base/configure-ec2config-service.ps1 | configure-ec2config-service.ps1 |
$ec2ConfigPath = Join-Path (Get-Item Env:\ProgramFiles).Value "Amazon\Ec2ConfigService\Settings"
$ec2ConfigFile = Join-Path $ec2ConfigPath "Config.xml"
#EC2Config
$config = Get-Content -Path $ec2ConfigFile -As [Xml]
foreach ($settingElem in $config.EC2ConfigurationSettings.Plugins.Plugin) {
if ($settin... |
PowerShellCorpus/Github/chrisagiddings_powershell-xml-archival/powershell-xml-archival.ps1 | powershell-xml-archival.ps1 | # Kroger Company Proprietary Property
# Written by Chris Giddings
# Updated August 6th 2014
#
# This script takes All XML files in specific directories from the past 24 hours,
# creates a zip file to hold them and inserts the files one by one into the zip,
# prior to deleting the originals.
#####################... |
PowerShellCorpus/Github/BrandonRoyal_build_demo/part1/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/BrandonRoyal_build_demo/part1/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/BrandonRoyal_build_demo/part1/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/BrandonRoyal_build_demo/part1/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/BrandonRoyal_build_demo/part1/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/BrandonRoyal_build_demo/part1/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/BrandonRoyal_build_demo/part1/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/BrandonRoyal_build_demo/part1/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
if ($project.Type -eq 'Web Site') {
Import-Module (Join-Path $toolsPath VS.psd1)
$srcFiles = Join-Path $installPath "lib\net40\*.dll"
$projectRoot = Get-ProjectRoot $project
if (!$projectRoot) {
return;
}
$destDirec... |
PowerShellCorpus/Github/BrandonRoyal_build_demo/part1/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Uninstall.ps1 | Uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
if ($project.Type -eq 'Web Site') {
Import-Module (Join-Path $toolsPath VS.psd1)
$projectRoot = Get-ProjectRoot $project
if (!$projectRoot) {
return;
}
$binDirectory = Join-Path $projectRoot "bin"
$srcDirectory = Join-Path $... |
PowerShellCorpus/Github/BrandonRoyal_build_demo/part1/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/BrandonRoyal_build_demo/part1/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$projectRoot = $project.Properties.Item('FullPath').Value
$binDirectory = Join-Path $projectRoot 'bin'
$targetDirectory = Join-Path $binDirectory $roslynSubFolder
if (Te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.