full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/markallen13_Powershell-Tutorials/Using WMI.ps1
Using WMI.ps1
# Work script on working with WMI based cmdlets. Return to this at chapter 16. # # M. Cockrum 4/10/2017 # # WMI Repository > Namespaces > Classes > Instances # Two types of cmdlets: WMI cmdlets, and CIM cmdlets Get-WmiObject -Namespace root\cimv2 -List Get-WmiObject -Class win32_desktop -Filter "name='ED...
PowerShellCorpus/Github/Blacknight318_PSScripts/timeTracking.ps1
timeTracking.ps1
$task = "start" $time = Get-Date -Format HH:mm:ss $start = $time # $write = @() While ($task -ne $null) { $time = Get-Date -Format HH:mm:ss $timeDiff = New-TimeSpan $start $time $writeItem = New-Object System.Object $writeItem | Add-Member NoteProperty -Name "Description" -Value $task ...
PowerShellCorpus/Github/Blacknight318_PSScripts/adCompPoll.ps1
adCompPoll.ps1
$computer = Read-Host -Prompt 'Please enter computer name with * for wildcard' $DomainControllers = Get-ADDomainController -Filter * foreach($DC in $DomainControllers) { try{ $comp = Get-ADComputer -Filter 'Name -like $computer' -Server $DC } catch { Write-Host $DC.Name "Failed to read!" -f...
PowerShellCorpus/Github/Blacknight318_PSScripts/findADLockout.ps1
findADLockout.ps1
$user = Read-Host -Prompt 'Please enter username ' $prop = @('LockedOut', 'AccountLockoutTime', 'BadLogonCount', 'LastBadPasswordAttempt', 'LastLogonDate', 'msDS-UserPasswordExpiryTimeComputed') $DomainControllers = Get-ADDomainController -Filter * #You need at least one reachable Domain Controller(dc) for this to wo...
PowerShellCorpus/Github/BrendanSturges_getSCCMServiceStatus/getSCCMServiceStatus.ps1
getSCCMServiceStatus.ps1
function Get-FileName($initialDirectory){ [System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null $OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog $OpenFileDialog.initialDirectory = $initialDirectory $OpenFileDialog.filter = "All files (*.*)| *.*" $OpenFileDialo...
PowerShellCorpus/Github/OPSTest_E2E_Provision_1485529546265/.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/ajoberstar_dotfiles/Console_Defaults.ps1
Console_Defaults.ps1
# Script to configure the registry keys specified here for PowerShell # https://technet.microsoft.com/en-us/library/cc978570.aspx $RegistryKeys = @( ".", ".\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe" ".\%SystemRoot%_SysWOW64_WindowsPowerShell_v1.0_powershell.exe", ".\Windows PowerShell",...
PowerShellCorpus/Github/ajoberstar_dotfiles/install.ps1
install.ps1
$HomeDir = $env:USERPROFILE $DotfilesDir = $PsScriptRoot $DotfilesConfig = Join-Path -Path $DotfilesDir -ChildPath "config-win.edn" $LatestVersionUrl = "https://clojars.org/api/artifacts/org.ajoberstar/clj-dotfiles" $LatestVersion = Invoke-RestMethod -Uri $LatestVersionUrl -ContentType "application/json" | Select...
PowerShellCorpus/Github/ajoberstar_dotfiles/Microsoft.Powershell_profile.ps1
Microsoft.Powershell_profile.ps1
############################################################################### ## BEGIN Base concole config ############################################################################### $BackgroundColor = $Host.UI.RawUI.BackgroundColor $Colors = $Host.PrivateData $Colors.ErrorForegroundColor = [ConsoleColor]::R...
PowerShellCorpus/Github/ajoberstar_dotfiles/bin/atom-projects.ps1
atom-projects.ps1
$ProjectsFile = Join-Path -Path $env:USERPROFILE -ChildPath ".atom" | Join-Path -ChildPath "projects.cson" Join-Path -Path $env:USERPROFILE -ChildPath "projects" | Get-ChildItem | ForEach-Object { @{"title"=$_.Name; "paths"=@($_.FullName)} } | ConvertTo-Json | Out-File -FilePath $ProjectsFile -Encoding u...
PowerShellCorpus/Github/mossywell_PS3-xbmc-screen-reset/xbmc-screen-reset.ps1
xbmc-screen-reset.ps1
# Let's be strict Set-StrictMode -Version 2 # Enums Add-Type -TypeDefinition @" public enum LoggingLevel { Error, Warning, Information, Verbose, Debug, KitchenSink } "@ #DLL Imports $dllimport1 = @" [DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)] public static extern ...
PowerShellCorpus/Github/jjmay_PsScripts/PsScripts/SpUploadMatterDirectory.ps1
SpUploadMatterDirectory.ps1
# # SpUploadMatterDirectory.ps1 # Param( [Parameter(Mandatory=$True)] [string]$directory, [Parameter(Mandatory=$true)] [string]$ClientFolder, [Parameter(Mandatory=$true)] [string]$matterId, [Parameter(Mandatory=$true)] [string]$SpSite, [Parameter(Mandatory=$true)] [string]$SpLibrary, [string]...
PowerShellCorpus/Github/marska_powershell-function-template/Do-Something.ps1
Do-Something.ps1
function Do-Something { <# .SYNOPSIS Describe the function here. .DESCRIPTION Describe the function in more detail. .EXAMPLE Give an example of how to use it. .PARAMETER paramName Describe the function parameter here. #> [CmdletBinding()] param ( ...
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Preparation/Enable-DNSAuditing.ps1
Enable-DNSAuditing.ps1
Set-DnsServerDiagnostics -ComputerName DNS1 -DebugLogging 0x00002000
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Preparation/Get-LocalAdministrators.ps1
Get-LocalAdministrators.ps1
function Get-LocalAdministrators { param ( [Parameter(Mandatory=$true)] [string]$Computer ) $admins = Get-WMIObject -class win32_groupuser –computer $computer $admins = $admins | where {$_.groupcomponent –like '*"Administrators"'} $admins |Foreach{ $_.partcomponent –match “.+Domain\...
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Preparation/Show-InstalledSoftware.ps1
Show-InstalledSoftware.ps1
Get-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |Select DisplayName, DisplayVersion, Publisher, InstallDate, HelpLink, UninstallString
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Preparation/Show-LocalAdmins.ps1
Show-LocalAdmins.ps1
$computer = $env:COMPUTERNAME $adsi = [ADSI]("WinNT://$computer,computer") $groups = $adsi.psbase.children | Where {$_.psbase.schemaclassname -eq "Group"} | Select Name foreach ($group in $groups) { $group.name }
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Preparation/Confirm-ServiceAccounts.ps1
Confirm-ServiceAccounts.ps1
function Confirm-ServiceAccounts { param ( [Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [string]$Computer ) begin { Write-Verbose -message "Starting $($myinvocation.mycommand)" } process { Get-WmiObject -Class Win32_Service -ComputerName $computer | wh...
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Preparation/Show-LocalUsers.ps1
Show-LocalUsers.ps1
function Show-LocalUsers { param( [Parameter(Mandatory=$true)] [string]$computer ) $adsi = [ADSI]("WinNT://$computer,computer") $adsi.name $users = $adsi.psbase.children | Where {$_.psbase.schemaclassname -eq "User"} | Select Name foreach ($user in $users) { $user.name } <# .SYNOPSIS ...
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Identification/Compare-FilesExample.ps1
Compare-FilesExample.ps1
$ref = Import-Clixml C:\baseline\Admins.xml $diff = Get-LocalAdministrators Compare-Object $ref $diff –property Name
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Lessons Learned/Set-HardenedIE.ps1
Set-HardenedIE.ps1
$AdminKey = “HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}” $UserKey = “HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}” Set-ItemProperty -Path $AdminKey -Name “IsInstalled” -Value 1 Set-ItemProperty -Path $UserKey ...
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Lessons Learned/Update-GroupPolicy.ps1
Update-GroupPolicy.ps1
Get-ADComputer –filter * -Searchbase "ou=Servers, dc=domain,dc=com" | foreach{ Invoke-GPUpdate –computer $_.name -force}
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Lessons Learned/Set-HardenedJava.ps1
Set-HardenedJava.ps1
New-PSDrive -Name Y -PSProvider filesystem -Root “\\Primary-FS\C$\Program Files” if (Test-path -Path "Y:\Java\jre7") { Copy-Item deployment.config Y:\Java\jre7 Copy-Item deployment.properties Y:\Java\jre7
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Containment/Stop-NewProcesses.ps1
Stop-NewProcesses.ps1
Register-WmiEvent Win32_ProcessStartTrace -Action {Stop-Process -Id ($EventArgs.NewEvent.ProcessID)}
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Containment/Move-DFSData.ps1
Move-DFSData.ps1
New-DfsnFolderTarget -Path "\\Contoso\Accounting" -TargetPath "\\Backup-FS\Accounting" -ReferralPriorityClass SiteCostHigh Remove-DfsnFolderTarget -Path "\\Contoso\Accounting" -TargetPath "\\Primary-FS\Accounting
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Recovery/Set-LocalPasswords.ps1
Set-LocalPasswords.ps1
None
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Recovery/Move-DFSDataBack.ps1
Move-DFSDataBack.ps1
New-DfsnFolderTarget -Path "\\Contoso\Accounting" -TargetPath "\\Primary-FS\Accounting" -ReferralPriorityClass SiteCostHigh Remove-DfsnFolderTarget -Path "\\Contoso\Accounting" -TargetPath "\\Backup-FS\Accounting
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Recovery/Unregister-FolderMonitor.ps1
Unregister-FolderMonitor.ps1
Function Unregister-FileMonitor { Unregister-Event $changed.Id Unregister-Event $created.Id Unregister-Event $deleted.Id Unregister-Event $renamed.Id <# .SYNOPSIS DEMO CODE: Unregisters a previous file monitor. .DESCRIPTION DEMO CODE: Unregisters a previous file monitor. Must be in same session....
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Recovery/Set-DomainPasswords.ps1
Set-DomainPasswords.ps1
$NewPass1 = “TheFreakyNewPassword!” Get-ADUser | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "$NewPass1" -Force)
PowerShellCorpus/Github/PoshSec_MotorCityISSA2013/Recovery/Set-FolderMonitor.ps1
Set-FolderMonitor.ps1
Function Set-FolderMonitor { param( [Parameter(Mandatory=$true)] [Alias("FilePath")] [string]$Path ) if(Test-Path -Path $Path) { ## Setup Watcher .NET CLass $watcher = New-Object System.IO.FileSystemWatcher $watcher.Path = $Path $watcher.IncludeSubdirectories = $true $watcher.EnableRaisi...
PowerShellCorpus/Github/hello-azure_ratecardapi/GetBillingByPowershell(RateCardAPI).ps1
GetBillingByPowershell(RateCardAPI).ps1
clear # 说明:参考官方RATE CARE API定义:https://msdn.microsoft.com/en-us/library/azure/mt219004.aspx # 订阅ID $subscriptionId ="e0fbea86-6cf2-4b2d-81e2-9c59f4f96bcb" # API版本:支持 2015-06-01-preview、2016-08-31-preview两个值,参考:https://msdn.microsoft.com/en-us/library/azure/mt219005.aspx $apiVersion = "2016-08-31-pre...
PowerShellCorpus/Github/OPSTest_E2E_Provision_1484811980965/.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/psd401_powerschool-push-api/push-sectionApi.ps1
push-sectionApi.ps1
<# .SYNOPSIS Script To Query PowerSchool and Update API Data .DESCRIPTION Query Powerschool Database and then make web requests with each record to hit the PSD section api .NOTES File Name : push-sectionApi.ps1 Author : Kris Hagel - hagelk@psd401.net Date : March 26, 2015 Requires : AD Cmdlet...
PowerShellCorpus/Github/psd401_powerschool-push-api/push-studentApi.ps1
push-studentApi.ps1
<# .SYNOPSIS Script To Query PowerSchool and Update API Data .DESCRIPTION Query Powerschool Database and then make web requests with each record to hit the PSD student api .NOTES File Name : push-studentApi.ps1 Author : Kris Hagel - hagelk@psd401.net Date : March 25, 2015 Requires : AD Cmdlet...
PowerShellCorpus/Github/psd401_powerschool-push-api/push-enrollmentApi.ps1
push-enrollmentApi.ps1
<# .SYNOPSIS Script To Query PowerSchool and Update API Data .DESCRIPTION Query Powerschool Database and then make web requests with each record to hit the PSD enrollment api .NOTES File Name : push-enrollmentApi.ps1 Author : Kris Hagel - hagelk@psd401.net Date : March 26, 2015 Requires : AD ...
PowerShellCorpus/Github/DevCortez_fBar/Projects/fBar/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/DevCortez_fBar/Projects/fBar/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/DevCortez_fBar/Projects/fBar/packages/System.Data.SQLite.EF6.1.0.99.0/tools/net45/install.ps1
install.ps1
############################################################################### # # provider.ps1 -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### param($installPath, $toolsPath, $package, ...
PowerShellCorpus/Github/DevCortez_fBar/Projects/fBar/packages/System.Data.SQLite.EF6.1.0.99.0/tools/net451/install.ps1
install.ps1
############################################################################### # # provider.ps1 -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### param($installPath, $toolsPath, $package, ...
PowerShellCorpus/Github/DevCortez_fBar/Projects/fBar/packages/System.Data.SQLite.EF6.1.0.99.0/tools/net46/install.ps1
install.ps1
############################################################################### # # provider.ps1 -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### param($installPath, $toolsPath, $package, ...
PowerShellCorpus/Github/DevCortez_fBar/Projects/fBar/packages/System.Data.SQLite.EF6.1.0.99.0/tools/net40/install.ps1
install.ps1
############################################################################### # # provider.ps1 -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### param($installPath, $toolsPath, $package, ...
PowerShellCorpus/Github/Zero-man_comic-book-gallery/src/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/Zero-man_comic-book-gallery/src/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/GitHubVG_FoodOrder/FoodOrder/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/GitHubVG_FoodOrder/FoodOrder/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/GitHubVG_FoodOrder/FoodOrder/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/GitHubVG_FoodOrder/FoodOrder/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/GitHubVG_FoodOrder/FoodOrder/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/GitHubVG_FoodOrder/FoodOrder/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/GitHubVG_FoodOrder/FoodOrder/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/GitHubVG_FoodOrder/FoodOrder/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/GitHubVG_FoodOrder/FoodOrder/packages/AutoMapper.3.3.1/tools/wp8/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/GitHubVG_FoodOrder/FoodOrder/packages/AutoMapper.3.3.1/tools/wp8/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/GitHubVG_FoodOrder/FoodOrder/packages/AutoMapper.3.3.1/tools/sl5/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/GitHubVG_FoodOrder/FoodOrder/packages/AutoMapper.3.3.1/tools/sl5/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/GitHubVG_FoodOrder/FoodOrder/packages/AutoMapper.3.3.1/tools/windows8/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/GitHubVG_FoodOrder/FoodOrder/packages/AutoMapper.3.3.1/tools/windows8/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/GitHubVG_FoodOrder/FoodOrder/packages/AutoMapper.3.3.1/tools/MonoTouch/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/GitHubVG_FoodOrder/FoodOrder/packages/AutoMapper.3.3.1/tools/MonoTouch/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/GitHubVG_FoodOrder/FoodOrder/packages/AutoMapper.3.3.1/tools/MonoAndroid/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/GitHubVG_FoodOrder/FoodOrder/packages/AutoMapper.3.3.1/tools/MonoAndroid/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/GitHubVG_FoodOrder/FoodOrder/packages/AutoMapper.3.3.1/tools/wpa81/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/GitHubVG_FoodOrder/FoodOrder/packages/AutoMapper.3.3.1/tools/wpa81/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/GitHubVG_FoodOrder/FoodOrder/packages/AutoMapper.3.3.1/tools/net40/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/GitHubVG_FoodOrder/FoodOrder/packages/AutoMapper.3.3.1/tools/net40/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/GitHubVG_FoodOrder/FoodOrder/packages/EntityFramework.6.1.1/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) if (Get-Module | ?{ $_.Name -eq 'EntityFramework' }) { Remove-Module EntityFramework } Import-Module (Join-Path $toolsPath EntityFramework.psd1) # SIG # Begin signature block # MIIa4AYJKoZIhvcNAQcCoIIa0TCCGs0CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/GitHubVG_FoodOrder/FoodOrder/packages/EntityFramework.6.1.1/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) Initialize-EFConfiguration $project Add-EFProvider $project 'System.Data.SqlClient' 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' Write-Host Write-Host "Type 'get-help EntityFramework' to see all available Entity Framework comma...
PowerShellCorpus/Github/GitHubVG_FoodOrder/FoodOrder/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/Cheeseman5_CheeseyShellLib/Tools.ps1
Tools.ps1
$DEBUG = $true function Get-OSInfo { Param( [string]$computerName = "$localhost" ) Get-CimInstance -ClassName Win32_OperatingSystem ` -ComputerName $computerName } function Get-ProcessByState { param( [ValidateSet('Auto', 'Manual','Disabled')] ...
PowerShellCorpus/Github/Cheeseman5_CheeseyShellLib/EnvSetup.ps1
EnvSetup.ps1
# Change Directory cd F:\Projects\Powershell #----[ Helper Vars ]---------------------- $Shell = $Host.ui.RawUI #----[ Shell Manip ]----------------------
PowerShellCorpus/Github/osipenkom_light-sample-project/Ant.Cargo/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/osipenkom_light-sample-project/Ant.Cargo/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/osipenkom_light-sample-project/Ant.Cargo/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/osipenkom_light-sample-project/Ant.Cargo/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/osipenkom_light-sample-project/Ant.Cargo/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/osipenkom_light-sample-project/Ant.Cargo/packages/AutoMapper.3.3.1/tools/wp8/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/osipenkom_light-sample-project/Ant.Cargo/packages/AutoMapper.3.3.1/tools/wp8/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/osipenkom_light-sample-project/Ant.Cargo/packages/AutoMapper.3.3.1/tools/sl5/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/osipenkom_light-sample-project/Ant.Cargo/packages/AutoMapper.3.3.1/tools/sl5/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/osipenkom_light-sample-project/Ant.Cargo/packages/AutoMapper.3.3.1/tools/windows8/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/osipenkom_light-sample-project/Ant.Cargo/packages/AutoMapper.3.3.1/tools/windows8/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/osipenkom_light-sample-project/Ant.Cargo/packages/AutoMapper.3.3.1/tools/MonoTouch/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/osipenkom_light-sample-project/Ant.Cargo/packages/AutoMapper.3.3.1/tools/MonoTouch/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/osipenkom_light-sample-project/Ant.Cargo/packages/AutoMapper.3.3.1/tools/MonoAndroid/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/osipenkom_light-sample-project/Ant.Cargo/packages/AutoMapper.3.3.1/tools/MonoAndroid/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/osipenkom_light-sample-project/Ant.Cargo/packages/AutoMapper.3.3.1/tools/wpa81/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/osipenkom_light-sample-project/Ant.Cargo/packages/AutoMapper.3.3.1/tools/wpa81/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/osipenkom_light-sample-project/Ant.Cargo/packages/AutoMapper.3.3.1/tools/net40/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu...
PowerShellCorpus/Github/osipenkom_light-sample-project/Ant.Cargo/packages/AutoMapper.3.3.1/tools/net40/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/osipenkom_light-sample-project/Ant.Cargo/packages/jQuery.2.1.4/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/osipenkom_light-sample-project/Ant.Cargo/packages/jQuery.2.1.4/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/osipenkom_light-sample-project/Ant.Cargo/packages/jQuery.2.1.4/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/osipenkom_light-sample-project/Ant.Cargo/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/osipenkom_light-sample-project/Ant.Cargo/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/osipenkom_light-sample-project/Ant.Cargo/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/osipenkom_light-sample-project/Ant.Cargo/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/craibuc_PsTokens/Merge-Tokens.Tests.ps1
Merge-Tokens.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here\$sut" Describe "Merge-Tokens" { # # arrange # $data=@" /* Author: __Author.Name__ <__Author.Email__> Analyst: __Analyst.Name__ <__Analyst.Email...
PowerShellCorpus/Github/craibuc_PsTokens/PsTokens.Tests.ps1
PsTokens.Tests.ps1
Import-Module PsTokens -Force Describe "PsTokens" { }
PowerShellCorpus/Github/craibuc_PsTokens/Merge-Tokens.ps1
Merge-Tokens.ps1
<# .SYNOPSIS Replaces tokens in a block of text with a specified value. .DESCRIPTION Replaces tokens in a block of text with a specified value. .PARAMETER template The block of text that contains text and tokens to be replaced. .PARAMETER tokens Token name/value hashtable. .EXAMPLE $content = Get-Con...
PowerShellCorpus/Github/rkuehfus_PowerShellModule/Get-Timezone.ps1
Get-Timezone.ps1
#requires -version 2 <# .SYNOPSIS Use PowerShell to pull out specify TimeZone data from an object .DESCRIPTION Use PowerShell to pull out specify TimeZone data from an object .PARAMETER <Parameter_Name> <Brief description of parameter input required. Repeat this attribute if required> .INPUTS String ...