full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/fraszkaa_ZTW2/BootstrapSite1/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/fraszkaa_ZTW2/BootstrapSite1/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/fraszkaa_ZTW2/BootstrapSite1/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/MSUDenverSystemsEngineering_Gephi/Deploy-Application.ps1
Deploy-Application.ps1
<# .SYNOPSIS This script performs the installation or uninstallation of an application(s). .DESCRIPTION The script is provided as a template to perform an install or uninstall of an application(s). The script either performs an "Install" deployment type or an "Uninstall" deployment type. The install deploymen...
PowerShellCorpus/Github/MSUDenverSystemsEngineering_Gephi/AppDeployToolkit/AppDeployToolkitExtensions.ps1
AppDeployToolkitExtensions.ps1
<# .SYNOPSIS This script is a template that allows you to extend the toolkit with your own custom functions. .DESCRIPTION The script is automatically dot-sourced by the AppDeployToolkitMain.ps1 script. .NOTES Toolkit Exit Code Ranges: 60000 - 68999: Reserved for built-in exit codes in Deploy-Applicatio...
PowerShellCorpus/Github/MSUDenverSystemsEngineering_Gephi/AppDeployToolkit/AppDeployToolkitMain.ps1
AppDeployToolkitMain.ps1
<# .SYNOPSIS This script contains the functions and logic engine for the Deploy-Application.ps1 script. .DESCRIPTION The script can be called directly to dot-source the toolkit functions for testing, but it is usually called by the Deploy-Application.ps1 script. The script can usually be updated to the latest v...
PowerShellCorpus/Github/MSUDenverSystemsEngineering_Gephi/AppDeployToolkit/AppDeployToolkitHelp.ps1
AppDeployToolkitHelp.ps1
<# .SYNOPSIS Displays a graphical console to browse the help for the App Deployment Toolkit functions .DESCRIPTION Displays a graphical console to browse the help for the App Deployment Toolkit functions .EXAMPLE AppDeployToolkitHelp.ps1 .NOTES .LINK http://psappdeploytoolkit.com #> ##*================...
PowerShellCorpus/Github/iqans_WebAppWithMySQL/WebAppWithMySQL/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/iqans_WebAppWithMySQL/WebAppWithMySQL/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/iqans_WebAppWithMySQL/WebAppWithMySQL/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/iqans_WebAppWithMySQL/WebAppWithMySQL/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/iqans_WebAppWithMySQL/WebAppWithMySQL/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/iqans_WebAppWithMySQL/WebAppWithMySQL/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/iqans_WebAppWithMySQL/WebAppWithMySQL/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/iqans_WebAppWithMySQL/WebAppWithMySQL/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/iqans_WebAppWithMySQL/WebAppWithMySQL/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/iqans_WebAppWithMySQL/WebAppWithMySQL/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/iqans_WebAppWithMySQL/WebAppWithMySQL/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/iqans_WebAppWithMySQL/WebAppWithMySQL/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/patvin80_AzureDeployment/CreateSiteStarter.ps1
CreateSiteStarter.ps1
#Usage: PowerShell -ExecutionPolicy Bypass -File .\CreateSiteStarter.ps1 %1 param( [string]$projectName = "AzurePublishWebsite" ) #Must be the first statement in your script # Security Configuration - So the Power Shell Script can connect to Your Azure Subscription # Follow instructions to download this fil...
PowerShellCorpus/Github/patvin80_AzureDeployment/Cleanup.ps1
Cleanup.ps1
param( [string]$projectName = "AzurePublishWebsite" ) #Must be the first statement in your script # Security Configuration # Used to connect to the Subscription Import-AzurePublishSettingsFile –PublishSettingsFile "YOUR_CREDENTIALS_FILE.publishsettings" Select-AzureSubscription -Default –SubscriptionNa...
PowerShellCorpus/Github/Hybrid-SaaS_Handy-code/Visual-studio/Debugging/test.ps1
test.ps1
$vsversion = "12.0" # VS 2013 (optionally 11, 10, 9, etc.) kill -name devenv # end any existing VS instances (optional) Get-ItemProperty -Path "HKCU:\Software\Microsoft\VisualStudio\$vsversion\Debugger" -Name DisableAttachSecurityWarning # query value Set-ItemProperty -Path "HKCU:\Software\Microsoft\VisualStudio\$...
PowerShellCorpus/Github/Gyrferret_public-powershell/Get-IPInfo.ps1
Get-IPInfo.ps1
function Get-IPInfo { param ( [Parameter(ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True, Mandatory=$True)] [Alias('IP')] [STRING[]]$IPAddress, [Parameter(ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True, ...
PowerShellCorpus/Github/Gyrferret_public-powershell/Netmask to Gateway.ps1
Netmask to Gateway.ps1
$subnet = "255.255.0.192" $subsplit = $subnet.Split(".") | where {$_ -ne "255" -and $_ -ne "0"} $octets = ((($subnet.Split(".") | where {$_ -eq "255"}).Count) * 8) Write-Output "Octets equals $octets" Write-Output "Subsplit equals $subsplit" if (!($subsplit -eq $null)) { for ($i = 1; $b -ne $subsplit; $i++) ...
PowerShellCorpus/Github/Gyrferret_public-powershell/Get-ChilditemEnhanced.ps1
Get-ChilditemEnhanced.ps1
$time = (Get-Date).AddDays(-100) $size = 30MB $path = "C:\Users\Awesome\Downloads\" Get-ChildItem $path | where length -GT $size Get-ChildItem $path | where creationtime -gt $time Get-ChildItem $path | where creationtime -lt $time
PowerShellCorpus/Github/Gyrferret_public-powershell/Reddit_API.ps1
Reddit_API.ps1
function Get-RedditToken { $user = "user" $password = "password" $clientID = "clientID" $clientSecret = ConvertTo-SecureString "secret" -AsPlainText -Force $creds = New-Object -TypeName System.management.Automation.PSCredential -ArgumentList $clientID, $clientSecret $credentials = @{ grant_type = "passwo...
PowerShellCorpus/Github/Gyrferret_public-powershell/Fix-Disk.ps1
Fix-Disk.ps1
function fix-disk { param ([switch]$sql) BEGIN {} PROCESS{ if ($SQL) { onlinedisks -SQL $true } else { onlinedisks -SQL $false} }#end process END {} } function onlinedisks { param ($SQL) $disks = Get-D...
PowerShellCorpus/Github/Gyrferret_public-powershell/cat_class.ps1
cat_class.ps1
[string]$pref = Read-Host "Would you like to speak to the cat?" if ($pref -contains "y") {Write-Output "Speak to the cat" $voice = Read-Host "What should the cat say?" talk -words $voice } else{ $pref2 = Read-Host "Would you rather the cat speak to you?" if ($pref2 -contains "y"...
PowerShellCorpus/Github/Gyrferret_public-powershell/Get-Hackers.ps1
Get-Hackers.ps1
## This Script gets IP Address of failed authentication attempts $event = Get-EventLog -LogName Security -InstanceId 4625 -Newest 1 #Gets all events that are 4625 (failed authentication) foreach($events in $event) { $regexp = '\d{1,3}[.]\d{1,3}[.]\d{1,3}[.]\d{1,3}' # Regular expression for IP addresses ...
PowerShellCorpus/Github/Gyrferret_public-powershell/Split-File.ps1
Split-File.ps1
Function Split-File { Param( [Parameter(Mandatory=$true)] [string]$file, [Parameter(Mandatory=$true, HelpMessage="Enter the destination path for split files" )] [string]$path, $quantity = 3MB) # End Param BEGIN{ #Begin BEGIN if(!(Test-Path $fil...
PowerShellCorpus/Github/Gyrferret_public-powershell/Get-Password.ps1
Get-Password.ps1
function Get-Password { param( [int] $length = 12, [int] $quantity = 1, [switch] $complex, [switch] $nonalphanumeric ) BEGIN{ #Based upon the switch that is selected ($complex, $nonalphanumeric), selects the appropriate #character base to utilize for password generation. If ($nonalphanumeric) { ...
PowerShellCorpus/Github/Gyrferret_public-powershell/Join-Files.ps1
Join-Files.ps1
function Join-Files { [CmdletBinding()] Param( [Parameter(Mandatory=$true, HelpMessage="Enter the Directory for the Files to Join" )] [string]$Directory, [Parameter( HelpMessage="Enter the destination file with which to write to." )] [st...
PowerShellCorpus/Github/Gyrferret_public-powershell/Gateway calculator.ps1
Gateway calculator.ps1
function Get-IPInfo { param ( [Parameter(ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True, Mandatory=$True)] [Alias('IP')] [STRING[]]$IPAddress, [Parameter(ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True, ...
PowerShellCorpus/Github/jayinoz99_hello-world/badtoo.ps1
badtoo.ps1
$ScriptName = $MyInvocation.MyCommand.Name Write-Host Write-Host Write-Host "---------------------------------" Write-Host " File name " $ScriptName " is" Write-Host " encrypting your documents" Write-Host "---------------------------------" Write-Host " Press any key to continue ..." Write-Host "-----------...
PowerShellCorpus/Github/jayinoz99_hello-world/file1.ps1
file1.ps1
$ScriptName = $MyInvocation.MyCommand.Name Write-Host Write-Host Write-Host Write-Host Write-Host Write-Host Write-Host " .-----------------------------------------------------------------." Write-Host " | Fileless malware demonstration using PowerShell |" Write-Host " |---------------...
PowerShellCorpus/Github/spoonypirate_Scripts/Get-CMErrorMessage.ps1
Get-CMErrorMessage.ps1
function Get-CMErrorMessage { [CmdletBinding()] param ( [Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)] [int64]$ErrorCode ) [void][System.Reflection.Assembly]::LoadFrom("C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\b...
PowerShellCorpus/Github/spoonypirate_Scripts/Load-Vagrant.ps1
Load-Vagrant.ps1
Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent) try { Import-Module vagrant-status function prompt { Write-Host($pwd.ProviderPath) -nonewline Write-VagrantStatusDetailed return "> " } } catch {} Pop-Location
PowerShellCorpus/Github/spoonypirate_Scripts/Get-PerformanceHistory.ps1
Get-PerformanceHistory.ps1
##requires -version 2.0 ## Get-PerformanceHistory.ps1 ############################################################################################################## ## Lets you see the amount of time recent commands in your history have taken ## History: ## v2.53 - added back the Lines, Words, and Characters .... ...
PowerShellCorpus/Github/spoonypirate_Scripts/Set-ProfileScriptSignature.ps1
Set-ProfileScriptSignature.ps1
<# Re-run this if you have updated any scripts in your profile this script will attempt to sign the following files with the first available code signing certificate if they are not in a currently valid signed state: - $Profile (Typically C:\Users\<userid>\Documents\WindowsPowerShell\Microsoft.PowerShel...
PowerShellCorpus/Github/spoonypirate_Scripts/Remove-PCFromADSCCM.ps1
Remove-PCFromADSCCM.ps1
<# .SYNOPSIS Deletes computer from SCCM and AD .DESCRIPTION Queries AD & SCCM, deletes the computer account from AD, and removes the computer object from SCCM .PARAMETER computerName Name of computer to delete from AD/SCCM .PARAMETER sccmServer Name of the SCCM server to use .PARAMETER sccmSite...
PowerShellCorpus/Github/spoonypirate_Scripts/Start-ApprovalManager.ps1
Start-ApprovalManager.ps1
################################################################################################################################################################### # Project: Application Approval Manager # Date: 2-5-2013 # By: Peter van der Woude # Version: 0.8 Public # Usage: PowerShell.exe -ExecutionPolicy ByPas...
PowerShellCorpus/Github/spoonypirate_Scripts/Enable-RemotePSRemoting.ps1
Enable-RemotePSRemoting.ps1
############################################################################## ## ## Enable-RemotePsRemoting ## ## From Windows PowerShell Cookbook (O'Reilly) ## by Lee Holmes (http://www.leeholmes.com/guide) ## ############################################################################## <# .SYNOPSIS ...
PowerShellCorpus/Github/spoonypirate_Scripts/Unsign-AllScripts.ps1
Unsign-AllScripts.ps1
<# .SYNOPSIS Finds all signed ps1 and psm1 files recursively from the current or defined path and removes any digital signatures attached to them. .DESCRIPTION Finds all signed ps1 and psm1 files recursively from the current or defined path and removes any digital signatures attached to them. .PARAMETER Path Pa...
PowerShellCorpus/Github/spoonypirate_Scripts/Set-OSDInfo.ps1
Set-OSDInfo.ps1
<# .SYNOPSIS Sets information during OSD. .DESCRIPTION This script will add build, task sequence, and other information to the OS so that it can later be examined or inventoried. Information can be added to the registry, WMI, or both. .PARAMETER Registry This switch will add information to the foll...
PowerShellCorpus/Github/spoonypirate_Scripts/Set-AccountPictureFromAD.ps1
Set-AccountPictureFromAD.ps1
# Full permissions must be given to: # HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AccountPicture\Users # picture must be added in AD already via # Set-ADUser $user -Replace @{thumbnailPhoto=([byte[]](Get-Content "$location\$user.jpg" -Encoding byte))} [CmdletBinding(SupportsShouldProcess=$true)]Param() fu...
PowerShellCorpus/Github/spoonypirate_Scripts/Remove-ScriptSignature.ps1
Remove-ScriptSignature.ps1
[CmdletBinding()] Param ( [Parameter(position=0)] [string]$signedFile ) $filecontent = Get-Content $signedFile $filecontent[0..(((Get-Content $signedFile | select-string "SIG # Begin signature block").LineNumber)-2)] | Set-Content $signedFile
PowerShellCorpus/Github/spoonypirate_Scripts/CTWMIandPowerShellExplorer.ps1
CTWMIandPowerShellExplorer.ps1
<# CORETECH A/S SOFTWARE LICENSE TERMS These license terms are an agreement between Coretech A/S and you. Please read them. They apply to the software you are downloading from Coretech.dk, which includes the media on which you received it, if any. The terms also apply to any Coretech A/S updates fo...
PowerShellCorpus/Github/spoonypirate_Scripts/LenovoWarranty.ps1
LenovoWarranty.ps1
$test = Invoke-WebRequest -uri http://support.lenovo.com/us/en/warrantylookup -SessionVariable ln $form = $test.forms[0] $serial = 'MJ01CHTT' $form.Fields["serialCode"]="$($serial)" $answer = Invoke-WebRequest -Uri ("http://support.lenovo.com" + $form.Action) -WebSession $ln -Method $form.Method -Body $form.Fields ...
PowerShellCorpus/Github/spoonypirate_Scripts/WPF-ControlExplorer.ps1
WPF-ControlExplorer.ps1
########################################################################## ## WPF CONTROL EXPLORER ## ## v1.0 ## ## Author: Trevor Jones ## ## Released: 26-...
PowerShellCorpus/Github/spoonypirate_Scripts/Get-GroupPolicyObject.ps1
Get-GroupPolicyObject.ps1
<# .Synopsis Queries AD for Group Policy objects .DESCRIPTION This script uses the DirectoryServices.DirectorySearcher object to get all or a selection of Group Policy Objects. .NOTES Name: Get-GroupPolicyObject.ps1 Author: Jaap Brasser Version: 1.0 DateCreated: 2013-07-30 DateUpdated: 2013-07-30 .L...
PowerShellCorpus/Github/spoonypirate_Scripts/New-CodeSigningCertificate.ps1
New-CodeSigningCertificate.ps1
<# .SYNOPSIS Creates a self-signed local CA and then creates a code signing certificate from it. .DESCRIPTION Creates a self-signed local CA and then creates a code signing certificate from it. .PARAMETER Horse Forcefully creates another code signing certificate (AND trusted CA) even if a code sig...
PowerShellCorpus/Github/spoonypirate_Scripts/Get-DellWarrantyInfo.ps1
Get-DellWarrantyInfo.ps1
[CmdletBinding()] Param( [Parameter(Mandatory=$true)] [array]$computer, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$APIkey ) foreach ($computername in $computer) { $ServiceTag = Get-WmiObject -Class Win32_Bios -ComputerName ...
PowerShellCorpus/Github/spoonypirate_Scripts/DellWarrantyWMIReports/WriteDellWarranty2WMI.ps1
WriteDellWarranty2WMI.ps1
<# Write Dell Warranty Information to WMI V2.2 Queries Dell Web Service API V4 for Warranty Info Creates Custom WMI Namespace and Class Writes Warranty Info to WMI Requires PowerShell V5 --------------- #> [CmdletBinding()] Param( [Parameter(Mandatory=$true,Position=1,HelpMessage="APIKey")] [Valida...
PowerShellCorpus/Github/spoonypirate_Scripts/poshcat/Start-PoshCAT.ps1
Start-PoshCAT.ps1
<# CORETECH A/S SOFTWARE LICENSE TERMS These license terms are an agreement between Coretech A/S and you. Please read them. They apply to the software you are downloading from Coretech.dk, which includes the media on which you received it, if any. The terms also apply to any Coretech A/S updates fo...
PowerShellCorpus/Github/spoonypirate_Scripts/poshcat/WorkerFunctions.ps1
WorkerFunctions.ps1
Function Save-FailedComputers { Param( $Path ,$FailedComputersInfo ) Begin{ Create-ReportFolder } Process{ foreach($item in $FailedComputersInfo){ $Dobject = New-Object PSObject $Dobject | Add-Member -MemberType NoteProperty...
PowerShellCorpus/Github/spoonypirate_Scripts/poshcat/SharedFunctions.ps1
SharedFunctions.ps1
$FolderIcon = " iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE...
PowerShellCorpus/Github/spoonypirate_Scripts/CasumV0.1/Start-CMAutomatedSoftwareUpdateProcess.ps1
Start-CMAutomatedSoftwareUpdateProcess.ps1
Param( $ConfigurationFile = 'I:\CoretechNoADR\Configuration.xml' ) #################### ********************************* SCRIPT ENTRY POINT *************************************** ########################################## # Clear the Errors $Error.Clear() #Import Coretech Configuration Pow...
PowerShellCorpus/Github/spoonypirate_Scripts/CasumV0.1/CTAutomatedSoftwareUpdateProcessWorker.ps1
CTAutomatedSoftwareUpdateProcessWorker.ps1
Param( $ConfigurationFile = 'I:\CoretechNoADR\Configuration.xml' ) ############################### ********************* SCRIPT ENTRY POINT **************** ################################################### # Clear all errors before $Error.Clear() #Import Coretech Configuration PowerShell Module ...
PowerShellCorpus/Github/spoonypirate_Scripts/itinfo/itinfo.ps1
itinfo.ps1
$Global:syncHash = [hashtable]::Synchronized(@{}) $newRunspace =[runspacefactory]::CreateRunspace() $newRunspace.ApartmentState = "STA" $newRunspace.ThreadOptions = "ReuseThread" $newRunspace.Open() $newRunspace.SessionStateProxy.SetVariable("syncHash",$syncHash) $psCmd = [PowerShell]::Create().AddScript(...
PowerShellCorpus/Github/spoonypirate_Scripts/ps2exe/test.ps1
test.ps1
#Demo file for use with PS2EXE (http://ps2exe.codeplex.com), part of PS2EXE v0.5.0.0 write-host "PS2EXE v0.5.0.0 by Ingo Karstein" -f Cyan write-host "" write-host "See " -f Yellow write-host " http://ps2exe.codeplex.com" -f Green write-host " http://blog.karstein-consulting.com" -f Green Write-Host "" $...
PowerShellCorpus/Github/spoonypirate_Scripts/ps2exe/ps2exe.ps1
ps2exe.ps1
param([string]$inputFile=$null, [string]$outputFile=$null, [switch]$verbose, [switch] $debug, [switch]$runtime20, [switch]$x86, [switch]$x64, [switch]$runtime30, [switch]$runtime40, [int]$lcid, [switch]$sta, [switch]$mta, [switch]$noConsole, [switch]$nested, [string]$iconFile=$null) <#############################...
PowerShellCorpus/Github/spoonypirate_Scripts/ps2exe/pcdesc.ps1
pcdesc.ps1
#Getting information about localhost. $SerialNum = (gwmi win32_bios).SerialNumber $user = $Env:Username $Manufacturer = (gwmi win32_ComputerSystem).Manufacturer $Model = (gwmi win32_ComputerSystem).Model $now = (Get-Date -format "MMM dd yyyy") $descr = $User + " - " + $Manufacturer + " " + $Model + " - " + $Ser...
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_NewRepo_2017_4_9_30_5_19/.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/sestalin1_Rentcar/RentCartWF/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/sestalin1_Rentcar/RentCartWF/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/mjisaak_azure/New-AzurePublishSettingsFile.ps1
New-AzurePublishSettingsFile.ps1
<# .Synopsis Creates an Azure publishettings file. .DESCRIPTION You must save the certificate to the current user store WITH the private key in order to use it with Import-AzurePublishSettingsFile cmdlet! #> Param( $SubscriptionId, $SubscriptionName, $CertificateLocation, $CertificateTh...
PowerShellCorpus/Github/mjisaak_azure/New-ServicePrincipal.ps1
New-ServicePrincipal.ps1
<# .Synopsis Creates an AAD application and service principal with contributor right to the specified subscription. #> Param ( [Parameter(Mandatory=$true)] [String] $CertificatePassword, [Parameter(Mandatory=$true)] [string] $SubscriptionName ) # variables $applicationDisplayName = '...
PowerShellCorpus/Github/unnatRevo_SoundPirates/MVC_Lessons/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/unnatRevo_SoundPirates/MVC_Lessons/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/unnatRevo_SoundPirates/MVC_Lessons/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/unnatRevo_SoundPirates/MVC_Lessons/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/unnatRevo_SoundPirates/MVC_Lessons/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/unnatRevo_SoundPirates/MVC_Lessons/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/unnatRevo_SoundPirates/MVC_Lessons/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/unnatRevo_SoundPirates/MVC_Lessons/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/alexwnovak_GitPowerShell/aliases.ps1
aliases.ps1
#================================================================================================== # Functions #================================================================================================== function Git-AddAll { git add -A } function Git-Branch { git branch } funct...
PowerShellCorpus/Github/alexwnovak_GitPowerShell/profile.ps1
profile.ps1
#================================================================================================== # GitHub Profile #================================================================================================== Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent) Import-Module \Git\...
PowerShellCorpus/Github/alexwnovak_GitPowerShell/Microsoft.PowerShell_profile.ps1
Microsoft.PowerShell_profile.ps1
#================================================================================================== # Microsoft.PowerShell_profile.ps1 #================================================================================================== # # This represents your user's PowerShell profile, and should be place here: # ...
PowerShellCorpus/Github/OPSTest_E2E_Provision_1485551141963/.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/OPS-E2E-PPE_E2E_NewRepo_2017_4_17_24_5_18/.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/ligershark_nuget-powershell/get-nugetps.ps1
get-nugetps.ps1
[cmdletbinding()] param( $versionToInstall = '0.2.6-beta', $toolsDir = ("$env:LOCALAPPDATA\LigerShark\nuget-ps\tools\"), $nugetDownloadUrl = 'http://nuget.org/nuget.exe' ) Set-StrictMode -Version Latest function Get-PsModulesPath{ [cmdletbinding()] param() process{ $Module...
PowerShellCorpus/Github/ligershark_nuget-powershell/appveyor.ps1
appveyor.ps1
$env:ExitOnPesterFail = $true $env:IsDeveloperMachine=$true $env:PesterEnableCodeCoverage = $true # $env:e2ePkgTestUseCustomMSDeploy=$true if($env:APPVEYOR_REPO_BRANCH -eq 'publish'){ .\build.ps1 -build -publishToNuget } elseif($env:APPVEYOR_REPO_BRANCH -eq 'publish-staging'){ .\build.ps1 -build -publ...
PowerShellCorpus/Github/ligershark_nuget-powershell/build.ps1
build.ps1
[cmdletbinding(DefaultParameterSetName ='build')] param( # actions [Parameter(ParameterSetName='build',Position=0)] [switch]$build, [Parameter(ParameterSetName='clean',Position=0)] [switch]$clean, [Parameter(ParameterSetName='getversion',Position=0)] [switch]$getversion, [...
PowerShellCorpus/Github/ligershark_nuget-powershell/tests/e2e.tests.ps1
e2e.tests.ps1
[cmdletbinding()] param() function Get-ScriptDirectory { $Invocation = (Get-Variable MyInvocation -Scope 1).Value Split-Path $Invocation.MyCommand.Path } $scriptDir = ((Get-ScriptDirectory) + "\") $moduleName = 'nuget-powershell' $modulePath = (Join-Path $scriptDir ('..\{0}.psd1' -f $moduleName)) ...
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Pester.Tests.ps1
Pester.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $manifestPath = "$here\Pester.psd1" $changeLogPath = "$here\CHANGELOG.md" # DO NOT CHANGE THIS TAG NAME; IT AFFECTS THE CI BUILD. Describe -Tags 'VersionChecks' "Pester manifest and changelog" { $script:manifest = $null It "has a valid manife...
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/build.psake.ps1
build.psake.ps1
$psake.use_exit_on_error = $true properties { $currentDir = resolve-path . $Invocation = (Get-Variable MyInvocation -Scope 1).Value $baseDir = $psake.build_script_dir $version = git.exe describe --abbrev=0 --tags $nugetExe = "$baseDir\vendor\tools\nuget" $targetBase = "tools" } Task d...
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/chocolateyInstall.ps1
chocolateyInstall.ps1
[CmdletBinding()] param ( ) end { $modulePath = Join-Path $env:ProgramFiles WindowsPowerShell\Modules $targetDirectory = Join-Path $modulePath Pester $scriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent $sourceDirectory = Join-Path $scriptRoot Tools Update-Directory -Source $s...
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Examples/Validator/Validator.Tests.ps1
Validator.Tests.ps1
function MyValidator($thing_to_validate) { return $thing_to_validate.StartsWith("s") } function Invoke-SomethingThatUsesMyValidator { param( [ValidateScript({MyValidator $_})] $some_param ) } Describe "Testing a validator" { It "calls MyValidator" { Mock MyVali...
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Examples/Calculator/Add-Numbers.ps1
Add-Numbers.ps1
function Add-Numbers($a, $b) { return $a + $b }
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Examples/Calculator/Add-Numbers.Tests.ps1
Add-Numbers.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path . "$here\Add-Numbers.ps1" Describe -Tags "Example" "Add-Numbers" { It "adds positive numbers" { Add-Numbers 2 3 | Should Be 5 } It "adds negative numbers" { Add-Numbers (-2) (-2) | Should Be (-4) } It "adds one ...
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/It.Tests.ps1
It.Tests.ps1
Set-StrictMode -Version Latest InModuleScope Pester { Describe 'Get-PesterResult' { It 'records the correct stack line number of failed tests' { #the $script scriptblock below is used as a position marker to determine #on which line the test failed. $errorRecord =...
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/TestsRunningInCleanRunspace.Tests.ps1
TestsRunningInCleanRunspace.Tests.ps1
function Invoke-PesterInJob ($ScriptBlock) { #TODO: there must be a safer way to determine this while I am in describe $PesterPath = Get-Module -Name Pester | Select -First 1 -ExpandProperty Path $job = Start-Job { param ($PesterPath, $TestDrive, $ScriptBlock) Import-Module $PesterPa...
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/TestDrive.ps1
TestDrive.ps1
# function New-TestDrive ([Switch]$PassThru) { $Path = New-RandomTempDirectory $DriveName = "TestDrive" if (-not (Microsoft.PowerShell.Management\Test-Path -Path $Path)) { New-Item -ItemType Container -Path $Path | Out-Null } #setup the test drive if ( -not (Test-Path "$...
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/BreakAndContinue.Tests.ps1
BreakAndContinue.Tests.ps1
Describe 'Clean handling of break and continue' { # If this test 'fails', it'll just cause most of the rest of the tests to never execute (and we won't see any actual failures.) # The CI job monitors metrics, though, and will fail the build if the number of tests drops too much. Context 'Break' { ...
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/New-Fixture.ps1
New-Fixture.ps1
function New-Fixture { <# .SYNOPSIS This function generates two scripts, one that defines a function and another one that contains its tests. .DESCRIPTION This function generates two scripts, one that defines a function and another one that contains its tests. The files are by defau...
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/TestResults.ps1
TestResults.ps1
function Get-HumanTime($Seconds) { if($Seconds -gt 0.99) { $time = [math]::Round($Seconds, 2) $unit = 's' } else { $time = [math]::Floor($Seconds * 1000) $unit = 'ms' } return "$time$unit" } function GetFullPath ([string]$Path) { if (-not [System.IO....
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/TestDrive.Tests.ps1
TestDrive.Tests.ps1
Set-StrictMode -Version Latest $tempPath = (Get-Item $env:temp).FullName Describe "Setup" { It "returns a location that is in a temp area" { $testDrivePath = (Get-Item $TestDrive).FullName $testDrivePath -like "$tempPath*" | Should Be $true } It "creates a drive location called ...
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/InModuleScope.Tests.ps1
InModuleScope.Tests.ps1
Set-StrictMode -Version Latest Describe "Module scope separation" { Context "When users define variables with the same name as Pester parameters" { $test = "This is a test." It "does not hide user variables" { $test | Should Be 'This is a test.' } } It "Does...
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/In.Tests.ps1
In.Tests.ps1
Set-StrictMode -Version Latest InModuleScope Pester { Describe "the In statement" { Setup -Dir "test_path" It "executes a command in that directory" { In "$TestDrive" -Execute { "" | Out-File "test_file" } "$TestDrive\test_file" | Should Exist } ...
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/SetupTeardown.ps1
SetupTeardown.ps1
function BeforeEach { <# .SYNOPSIS Defines a series of steps to perform at the beginning of every It block within the current Context or Describe block. .DESCRIPTION BeforeEach, AfterEach, BeforeAll, and AfterAll are unique in that they apply to the entire Context or Describe block, regardless...