full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/Nimaazizi86_AngularFinalAssignment/AngularAssignment/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/Nimaazizi86_AngularFinalAssignment/AngularAssignment/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/Nimaazizi86_AngularFinalAssignment/AngularAssignment/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/Nimaazizi86_AngularFinalAssignment/AngularAssignment/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/Nimaazizi86_AngularFinalAssignment/AngularAssignment/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/MSUDenverSystemsEngineering_Microsoft-.NET-Framework-4.6.2/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_Microsoft-.NET-Framework-4.6.2/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_Microsoft-.NET-Framework-4.6.2/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_Microsoft-.NET-Framework-4.6.2/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/v-peliao_E2E_NewRepo_1489714426307/.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/gabesterr_chromebookmoveou/chromebookmoveou.ps1
chromebookmoveou.ps1
# usage .\chromebookmoveou.ps1 -csv .\school-dept.csv -destinationOU "/Destination/Path/To/Container" # # use in conjunction with the dito GAM tool from http://www.ditoweb.com/dito-gam # # csv must have header with a "Serial Number" column and no trailing empty column, either google or samsung serials # csv may ha...
PowerShellCorpus/Github/erhan0_demand_driven/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/erhan0_demand_driven/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/3gstudent_Code-Execution-and-Process-Injection/6-Process Injection-Shellcode.ps1
6-Process Injection-Shellcode.ps1
function Invoke-Shellcode { <# .SYNOPSIS Inject shellcode into the process ID of your choosing or within the context of the running PowerShell process. PowerSploit Function: Invoke-Shellcode Author: Matthew Graeber (@mattifestation) License: BSD 3-Clause Required Dependencies: None Optional Dependencies: N...
PowerShellCorpus/Github/3gstudent_Code-Execution-and-Process-Injection/2-CodeExecution-Meterpreter.ps1
2-CodeExecution-Meterpreter.ps1
function Invoke-Shellcode { <# .SYNOPSIS Inject shellcode into the process ID of your choosing or within the context of the running PowerShell process. PowerSploit Function: Invoke-Shellcode Author: Matthew Graeber (@mattifestation) License: BSD 3-Clause Required Dependencies: None Optional Dependencies: N...
PowerShellCorpus/Github/3gstudent_Code-Execution-and-Process-Injection/1-CodeExecution-Shellcode.ps1
1-CodeExecution-Shellcode.ps1
function Invoke-Shellcode { <# .SYNOPSIS Inject shellcode into the process ID of your choosing or within the context of the running PowerShell process. PowerSploit Function: Invoke-Shellcode Author: Matthew Graeber (@mattifestation) License: BSD 3-Clause Required Dependencies: None Optional Dependencies: N...
PowerShellCorpus/Github/3gstudent_Code-Execution-and-Process-Injection/3-CodeExecution-ReadExe/3-CodeExecution-ReadExe.ps1
3-CodeExecution-ReadExe.ps1
function Invoke-ReflectivePEInjection { <# .SYNOPSIS This script has two modes. It can reflectively load a DLL/EXE in to the PowerShell process, or it can reflectively load a DLL in to a remote process. These modes have different parameters and constraints, please lead the Notes section (GENERAL NOTES) for in...
PowerShellCorpus/Github/3gstudent_Code-Execution-and-Process-Injection/5-CodeExecution-dll/5-CodeExecution-dll.ps1
5-CodeExecution-dll.ps1
function Invoke-ReflectivePEInjection { <# .SYNOPSIS This script has two modes. It can reflectively load a DLL/EXE in to the PowerShell process, or it can reflectively load a DLL in to a remote process. These modes have different parameters and constraints, please lead the Notes section (GENERAL NOTES) for in...
PowerShellCorpus/Github/3gstudent_Code-Execution-and-Process-Injection/7-Process Injection-dll/7-Process Injection-dll(win8x64).ps1
7-Process Injection-dll(win8x64).ps1
function Invoke-DllInjection { <# .SYNOPSIS Injects a Dll into the process ID of your choosing. PowerSploit Function: Invoke-DllInjection Author: Matthew Graeber (@mattifestation) License: BSD 3-Clause Required Dependencies: None Optional Dependencies: None .DESCRIPTION Invoke-DllInjection injects a ...
PowerShellCorpus/Github/3gstudent_Code-Execution-and-Process-Injection/7-Process Injection-dll/7-Process Injection-dll(new version).ps1
7-Process Injection-dll(new version).ps1
function Invoke-DllInjection { <# .SYNOPSIS Injects a Dll into the process ID of your choosing. PowerSploit Function: Invoke-DllInjection Author: Matthew Graeber (@mattifestation) License: BSD 3-Clause Required Dependencies: None Optional Dependencies: None .DESCRIPTION Invoke-DllInjection injects a ...
PowerShellCorpus/Github/3gstudent_Code-Execution-and-Process-Injection/7-Process Injection-dll/7-Process Injection-dll.ps1
7-Process Injection-dll.ps1
function Invoke-DllInjection { <# .SYNOPSIS Injects a Dll into the process ID of your choosing. PowerSploit Function: Invoke-DllInjection Author: Matthew Graeber (@mattifestation) License: BSD 3-Clause Required Dependencies: None Optional Dependencies: None .DESCRIPTION Invoke-DllInjection injects a ...
PowerShellCorpus/Github/3gstudent_Code-Execution-and-Process-Injection/4-CodeExecution-Exe(unicode+base64)/unicode+base64.ps1
unicode+base64.ps1
$PEBytes = [System.IO.File]::ReadAllBytes("test.exe") $UnicodeBytes = [System.Text.Encoding]::Unicode.GetBytes($PEBytes) $Base64Payload = [System.Convert]::ToBase64String($UnicodeBytes) Set-Content test.b64 -Value $Base64Payload
PowerShellCorpus/Github/3gstudent_Code-Execution-and-Process-Injection/4-CodeExecution-Exe(unicode+base64)/base64.ps1
base64.ps1
$PEBytes = [System.IO.File]::ReadAllBytes("C:\test\test.exe") $Base64Payload = [System.Convert]::ToBase64String($PEBytes) Set-Content test.b64 -Value $Base64Payload
PowerShellCorpus/Github/3gstudent_Code-Execution-and-Process-Injection/4-CodeExecution-Exe(unicode+base64)/4-CodeExecution-Exe(base64).ps1
4-CodeExecution-Exe(base64).ps1
function Invoke-ReflectivePEInjection { <# .SYNOPSIS This script has two modes. It can reflectively load a DLL/EXE in to the PowerShell process, or it can reflectively load a DLL in to a remote process. These modes have different parameters and constraints, please lead the Notes section (GENERAL NOTES) for in...
PowerShellCorpus/Github/3gstudent_Code-Execution-and-Process-Injection/4-CodeExecution-Exe(unicode+base64)/4-CodeExecution-Exe(unicode+base64).ps1
4-CodeExecution-Exe(unicode+base64).ps1
function Invoke-ReflectivePEInjection { <# .SYNOPSIS This script has two modes. It can reflectively load a DLL/EXE in to the PowerShell process, or it can reflectively load a DLL in to a remote process. These modes have different parameters and constraints, please lead the Notes section (GENERAL NOTES) for in...
PowerShellCorpus/Github/RenzoMarchena_LogicApps/MyLogicApp/MyLogicApp/Deploy-AzureResourceGroup.ps1
Deploy-AzureResourceGroup.ps1
#Requires -Version 3.0 #Requires -Module AzureRM.Resources #Requires -Module Azure.Storage Param( [string] [Parameter(Mandatory=$true)] $ResourceGroupLocation, [string] $ResourceGroupName = 'MyLogicApp', [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageContainerNam...
PowerShellCorpus/Github/prajeeshprathap_WorkflowSamples/Parallel-Workflow.ps1
Parallel-Workflow.ps1
Workflow Parallel-Sample{ $collection = @(1,2,3,4,5) foreach -parallel ($item in $collection) { "$item" Start-Sleep -Seconds 1 } }
PowerShellCorpus/Github/prajeeshprathap_WorkflowSamples/Simple-Workflow.ps1
Simple-Workflow.ps1
Workflow Hello-User{ "Hello $env:USERNAME" }
PowerShellCorpus/Github/glaisne_PowerShellO365Functions/Test-MsolUserExists.ps1
Test-MsolUserExists.ps1
function Test-MsolUserExists { <# .Synopsis Determines if a user exists in O365 .DESCRIPTION This function will return a simple $True or $False depending on the user's existence in Office365. .EXAMPLE Test-MsolUser -UserPrincipalName Gene@PowerShellNow.com This example will return $true if Ge...
PowerShellCorpus/Github/glaisne_PowerShellO365Functions/Test.ps1
Test.ps1
#Get-Variable |Ft * -force -auto $PSCommandPath #$PSCommandPath |gm * |ft * -force -AutoSize #Split-Path $PSCommandPath -Leaf Get-ChildItem -path $PSScriptRoot -filter "*.ps1" |Where-Object { $_.fullname -ne $PSCommandPath} | foreach { gc $_ | out-file "" }
PowerShellCorpus/Github/glaisne_PowerShellO365Functions/Get-MsolServiceStatus.ps1
Get-MsolServiceStatus.ps1
function Get-MsolServiceStatus { <# .Synopsis Get an Office365 user's Service Status .DESCRIPTION This script will gather all the services in a given license for a specified user and return their individual statuses. .EXAMPLE Test-MsolUserAppliedSku -UserPrincipalName Gene@PowerShellNow.com -sku 'p...
PowerShellCorpus/Github/glaisne_PowerShellO365Functions/Test-MsolUserAppliedSku.ps1
Test-MsolUserAppliedSku.ps1
function Test-MsolUserAppliedSku { <# .Synopsis Determines if a user has a given SKU in O365 .DESCRIPTION Based on the specified Sku, this script will test the given user and return if they have the given Sku applied to their licenses or not. .EXAMPLE Test-MsolUserAppliedSku -UserPrincipalName Gene...
PowerShellCorpus/Github/huiw-git_alicemt/.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 ur...
PowerShellCorpus/Github/vemoreno_TableStorageWithCsharp/AzureTableStorage/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/vemoreno_TableStorageWithCsharp/AzureTableStorage/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/vemoreno_TableStorageWithCsharp/AzureTableStorage/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/vemoreno_TableStorageWithCsharp/AzureTableStorage/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/vemoreno_TableStorageWithCsharp/AzureTableStorage/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/vemoreno_TableStorageWithCsharp/AzureTableStorage/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/vemoreno_TableStorageWithCsharp/AzureTableStorage/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/vemoreno_TableStorageWithCsharp/AzureTableStorage/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/vemoreno_TableStorageWithCsharp/AzureTableStorage/packages/Newtonsoft.Json.6.0.8/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/install?version=" + $package.Version $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) if ($dte2.ActiveWin...
PowerShellCorpus/Github/allburov_zabbixtools/POS/CheckSwap.ps1
CheckSwap.ps1
# (c) DevOpsHQ, 2016 # Author: Aleksey Burov, DevOps param ( [switch] $verbose ) ########### Define parameters ########### $OK_STATUS = "OK" $returnCode = "" ########### Print arguments and set debug ########### if ($verbose) { $DebugPreference = "Continue" Write-Debug "INFO - run...
PowerShellCorpus/Github/allburov_zabbixtools/POS/CheckDiskExistAndWrite.ps1
CheckDiskExistAndWrite.ps1
# (c) DevOpsHQ, 2016 # Author: Aleksey Burov, DevOps param ( [string] $disk, [switch] $verbose ) # Value mapping - add this value mapping to Zabbix web-interface $DISK_ERROR_IN_SCRIPT = 1000 $DISK_NOT_EXIST = 1001 $DISK_WRITE_FILE_ERROR = 1002 $DISK_CHANGE_FILE_ERROR = 1003 $DISK_DELETE_FILE_ERROR = 1004...
PowerShellCorpus/Github/allburov_zabbixtools/POS/ZabbixCommon.ps1
ZabbixCommon.ps1
# (c) DevOpsHQ, 2016 # Author: Aleksey Burov, DevOps # Common function
PowerShellCorpus/Github/allburov_zabbixtools/POS/GetFolderSize.ps1
GetFolderSize.ps1
# (c) DevOpsHQ, 2016 # Author: Aleksey Burov, DevOps param ( [string] $folder, [switch] $verbose ) ########### Define parameters ########### # Value mapping - add this value mapping to Zabbix web-interface $ERROR_IN_SCRIPT = -1 $FOLDER_NOT_EXIST_STATUS = -2 $returnCode = $ERROR_IN_SCRIPT ########...
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_Provision_2017_5_15_25_59_7/.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/v-peliao_TestForFeature.id-id/.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/mangersm_PS_UTS/run.ps1
run.ps1
Function Get-ChildItemToDepth { Param( [String]$Path = "C:\utils\test", [Byte]$ToDepth = 0, [Byte]$CurrentDepth = 0, [string]$CSVOutput = "C:\utils\output\out.dat" ) $CurrentDepth++ Get-ChildItem $Path | where {$_.PSIsContainer} | Where-Object {$_.LastWriteTime -le "03/...
PowerShellCorpus/Github/ducke_nanoserver/Ascii.ps1
Ascii.ps1
$ascii = @" _ __ __ _ _ __ ___ ___ ___ _ ____ _____ _ __ | '_ \ / _` | '_ \ / _ \/ __|/ _ \ '__\ \ / / _ \ '__| | | | | (_| | | | | (_) \__ \ __/ | \ V / __/ | |_| |_|\__,_|_| |_|\___/|___/\___|_| \_/ \___|_| "@ write-host $ascii
PowerShellCorpus/Github/ducke_nanoserver/BulkImport.ps1
BulkImport.ps1
[CmdletBinding()] param ( [int]$Count, [string]$ParentDisk, [string]$VMNamePrefix = 'NanoFTW', [string]$SwitchName = 'Internal' ) $CurrentDir = $PWD $RootVmPath = Join-Path $CurrentDir '\Virtual Machines' foreach ($i in $Count) { $VmName = '{0}{1}' -f $VMNamePrefix,$i Write-Verbose ('Cr...
PowerShellCorpus/Github/ducke_nanoserver/Automation.ps1
Automation.ps1
[CmdletBinding()] param ( [string]$IsoPath = 'C:\Downloads\en_windows_server_technical_preview_2_x64_dvd_6651466.iso', [string]$WorkingDir = (Join-Path ([System.IO.Path]::GetTempPath()) ([guid]::NewGuid().tostring())), [Parameter(Mandatory = $true)] [ValidateScript({Test-Path $_})] [string]$NanoServerS...
PowerShellCorpus/Github/ducke_nanoserver/NanoServer.ps1
NanoServer.ps1
$ErrorActionPreference = "Stop" $Script:LogFile = Join-Path $env:TEMP "New-NanoServerImage.log" $Script:DismLogFile = Join-Path $env:TEMP "New-NanoServerImage (DISM).log" ### ----------------------------------- ### Constants ### ----------------------------------- $IMAGE_NAME = "NanoServer.wim" $IMAGE_CONV...
PowerShellCorpus/Github/ducke_nanoserver/CleanState.ps1
CleanState.ps1
[CmdletBinding()] param ( [string]$VMNamePrefix = 'Nano' ) $Vms = Get-VM ('{0}*' -f $VMNamePrefix) If ([string]::IsNullOrEmpty($Vms)) { Write-Warning 'No Vms found! Exit' return } foreach ($Vm in $Vms) { Stop-VM $Vm -TurnOff -Force Remove-VM $Vm -Force Remove-Item $Vm.Path -Recurse -Force...
PowerShellCorpus/Github/JanRK_ITmatic/WindowsUpdate/DoWindowsUpdate.ps1
DoWindowsUpdate.ps1
param($global:RestartRequired=0, $global:MoreUpdates=0, $global:MaxCycles=5, $MaxUpdatesPerCycle=500) $Logfile = "C:\Windows\Temp\win-updates.log" function LogWrite { Param ([string]$logstring) $now = Get-Date -format s Add-Content $Logfile -value "$now $logstring" Write...
PowerShellCorpus/Github/alexmeise_powershell/searchForPattern.ps1
searchForPattern.ps1
Set Execution-Policy RemoteSigned Get-ChildItem C:\*.* -Recurse | Select-String -Pattern "password" -AllMatches | Format-Table -Wrap -Property LineNumber,Filename,Path | Tee-Object -File C:\results.txt Read-Host -Prompt "Press Enter to exit"
PowerShellCorpus/Github/alexmeise_powershell/modify_redirects.ps1
modify_redirects.ps1
#execute in C:\Windows\System32\inetsrv> as admin #Creates backup folder if not present if (!(Test-Path D:\Data\backups)){ mkdir D:\Data\backups Write-Host "Backup folder created" Write-Host "" } # reads alias from csv like: alias,URL Import-CSV D:\Data\alias.csv -Header alias,destination | Foreach-Object{...
PowerShellCorpus/Github/khaos-one_sakebuild/content/SakeBuild.ps1
SakeBuild.ps1
# Helper script for those who want to run psake without importing the module. # Example run from PowerShell: # .\psake.ps1 "default.ps1" "BuildHelloWord" "4.0" # Must match parameter definitions for psake.psm1/invoke-psake # otherwise named parameter binding fails param( [Parameter(Position=0,Mandatory=0)...
PowerShellCorpus/Github/khaos-one_sakebuild/tools/Install.ps1
Install.ps1
Param( [string] $installPath, [string] $toolsPath, [string] $package, [string] $project ) Write-Host "installPath: $installPath" Write-Host "toolsPath: $toolsPath" Write-Host "package: $package" Write-Host "project: $project"
PowerShellCorpus/Github/khaos-one_sakebuild/tools/Init.ps1
Init.ps1
Param( [string] $installPath, [string] $toolsPath, [string] $package, [string] $project ) Write-Host "installPath: $installPath" Write-Host "toolsPath: $toolsPath" Write-Host "package: $package" Write-Host "project: $project"
PowerShellCorpus/Github/OPSTest_E2E_Provision_2017_3_22_17_33_33/.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/lea2000_MiscellaneousPowershell/03_Register-Schtask_MiscPowershell.ps1
03_Register-Schtask_MiscPowershell.ps1
<# 03_Register-Schtask_MiscPowershell.ps1 Copyright (C) 2017 lea2000 This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later vers...
PowerShellCorpus/Github/lea2000_MiscellaneousPowershell/01_Show-Menu_MiscPowershell.ps1
01_Show-Menu_MiscPowershell.ps1
<# 01_Show-Menu_MiscPowershell.ps1 Copyright (C) 2017 lea2000 This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. ...
PowerShellCorpus/Github/lea2000_MiscellaneousPowershell/02_Invoke-ExternalCommand_MiscPowershell.ps1
02_Invoke-ExternalCommand_MiscPowershell.ps1
<# 02_Invoke-ExternalCommand_MiscPowershell.ps1 Copyright (C) 2017 lea2000 This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any late...
PowerShellCorpus/Github/PowerShell_Operation-Validation-Framework/Modules/VersionedModule/2.0.0/Diagnostics/Simple/PSGallery.Simple.Tests.ps1
PSGallery.Simple.Tests.ps1
Describe 'Simple Validation of PSGallery' -Tag 'AAABBBCCC' { It 'The PowerShell Gallery should be responsive' { $request = [System.Net.WebRequest]::Create('https://www.powershellgallery.com') $response = $Request.GetResponse() $response.StatusCode | Should be OK } } Describe 'Si...
PowerShellCorpus/Github/PowerShell_Operation-Validation-Framework/Modules/VersionedModule/1.0.0/Diagnostics/Simple/PSGallery.Simple.Tests.ps1
PSGallery.Simple.Tests.ps1
param( [string]$WebsiteUrl = 'https://www.powershellgallery.com', [string]$StatusCode = 'OK' ) Describe 'Simple Validation of PSGallery' -Tag 'AAABBBCCC' { It 'The PowerShell Gallery should be responsive' { $request = [System.Net.WebRequest]::Create($WebsiteUrl) $response = $Reque...
PowerShellCorpus/Github/PowerShell_Operation-Validation-Framework/Modules/OperationValidation/Test/OperationValidation.Tests.ps1
OperationValidation.Tests.ps1
$MyDir = [System.IO.Path]::GetDirectoryName($myInvocation.MyCommand.Definition) $moduleDir = (resolve-path "$myDir/../..").path Describe "OperationValidation Module Tests" { BeforeAll { $SavedModulePath = $env:PSModulePath if ( $env:psmodulepath.split(";") -notcontains $moduleDir ) {...
PowerShellCorpus/Github/PowerShell_Operation-Validation-Framework/Modules/OperationValidation/Diagnostics/Comprehensive/PSGallery.Comprehensive.Tests.ps1
PSGallery.Comprehensive.Tests.ps1
Describe "E2E validation of PSGallery" { BeforeAll { $Repository = "InternalPSGallery" $ModuleName = "FormatTools" $Version = "0.5.0" import-module PowerShellGet -Force if ( Get-Module -list ${ModuleName} ) { # the module is already installed ...
PowerShellCorpus/Github/PowerShell_Operation-Validation-Framework/Modules/OperationValidation/Diagnostics/Simple/PSGallery.Simple.Tests.ps1
PSGallery.Simple.Tests.ps1
Describe "Simple Validation of PSGallery" { It "The PowerShell Gallery should be responsive" { $request = [System.Net.WebRequest]::Create("http://psget/psgallery") $response = $Request.GetResponse() $response.StatusCode | Should be OK } }
PowerShellCorpus/Github/PowerShell_Operation-Validation-Framework/Modules/Example.WindowsSearch/Diagnostics/Simple/WindowsSearch.Simple.Tests.ps1
WindowsSearch.Simple.Tests.ps1
Describe "Windows Search finds the proper application" { It "Finds notepad" { $con = new-object -com ADODB.Connection $rs = new-object -com ADODB.RecordSet $con.Open("Provider=Search.CollatorDSO;Extended properties='Application=Windows';") $rs.Open("Select System.ItemPathDisplay...
PowerShellCorpus/Github/PPE-4_Congres/Gestion_Congres/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/PPE-4_Congres/Gestion_Congres/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/saragowen89_GroovyThingBob/WebApplicationUnicorn/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/saragowen89_GroovyThingBob/WebApplicationUnicorn/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/saragowen89_GroovyThingBob/WebApplicationUnicorn/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/saragowen89_GroovyThingBob/WebApplicationUnicorn/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/saragowen89_GroovyThingBob/WebApplicationUnicorn/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/saragowen89_GroovyThingBob/WebApplicationUnicorn/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/saragowen89_GroovyThingBob/WebApplicationUnicorn/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/saragowen89_GroovyThingBob/WebApplicationUnicorn/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/saragowen89_GroovyThingBob/WebApplicationUnicorn/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/saragowen89_GroovyThingBob/WebApplicationUnicorn/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/saragowen89_GroovyThingBob/WebApplicationUnicorn/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/Tanyatang0_Tanyatang0Repo1028024626.zh-cn/.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/markareiss_Find-DotSource/Find-DotSource.ps1
Find-DotSource.ps1
<# .Synopsis Searches local drive for ".ps1" with the same name. After 1st occurance it "dot sources" the ps1. .DESCRIPTION Searches local drive for ".ps1" with the same name. After 1st occurance it "dot sources" the ps1. Takes the default root first if run as a script and not inline. Does not need ".ps1"...
PowerShellCorpus/Github/Uriil_wix-template/src/createInstaller.ps1
createInstaller.ps1
PARAM ( [Parameter(Mandatory=$true)] [string] $DirectoryToCollect, [Parameter(Mandatory=$true)] [string] $ApplicationName, [Parameter(Mandatory=$false)] [string] $InputWixFile = "application.wxs", [Parameter(Mandatory=$false)] [string] $InstallationFile = "None" ) $env:ApplicationName = "$Appli...
PowerShellCorpus/Github/forrestbrink_BloodBank/BloodBank/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/forrestbrink_BloodBank/BloodBank/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/forrestbrink_BloodBank/BloodBank/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/forrestbrink_BloodBank/BloodBank/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/forrestbrink_BloodBank/BloodBank/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/forrestbrink_BloodBank/BloodBank/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/forrestbrink_BloodBank/BloodBank/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/forrestbrink_BloodBank/BloodBank/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/forrestbrink_BloodBank/BloodBank/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/forrestbrink_BloodBank/BloodBank/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/forrestbrink_BloodBank/BloodBank/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/forrestbrink_BloodBank/BloodBank/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/QuietusPlus_Write-Menu/Write-Menu.ps1
Write-Menu.ps1
<# The MIT License (MIT) Copyright (c) 2016 QuietusPlus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights ...
PowerShellCorpus/Github/QuietusPlus_Write-Menu/Examples/AppxPackages.ps1
AppxPackages.ps1
<# Example: AppxPackages #> # Include . ..\Write-Menu.ps1 $menuReturn = Write-Menu -Title 'AppxPackages' -Entries (Get-AppxPackage).Name Write-Host $menuReturn