full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/episource_my-chocolatey/wix/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
Set-StrictMode -Version latest $ErrorAction = "Stop" $toolsDir = "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)" Install-StartMenuLink -LinkName "Wix Toolset" -TargetPath "$toolsDir" Set-AutoShim -Pattern "tools/sdk/**" -Mode Ignore | Out-Null
PowerShellCorpus/Github/episource_my-chocolatey/vlc/_build.ps1
_build.ps1
# Enable common parameters [CmdletBinding()] Param() # Import my-chocolatey config & modules . $PSScriptRoot/../_root.ps1 $fileListUrl = "http://download.videolan.org/vlc/last/win64" $fileList = Invoke-Webrequest -UseBasicParsing $fileListUrl $zipRegex = "vlc-(?<VERSION>\d+(?:\.\d+){1,2})-win64\.zip" $zipU...
PowerShellCorpus/Github/episource_my-chocolatey/vlc/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
$toolsDir = "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)" $exe64 = Get-Item "$toolsDir/vlc-$env:chocolateyPackageVersion/vlc.exe" Install-StartMenuLink -LinkName "VLC" -TargetPath $exe64 Set-AutoShim -Pattern $exe64 -Invert -Mode Ignore | Out-Null
PowerShellCorpus/Github/episource_my-chocolatey/fileseek/_build.ps1
_build.ps1
# Enable common parameters [CmdletBinding()] Param() # Import my-chocolatey config & modules . $PSScriptRoot/../_root.ps1 $versionRegex = 'Latest Version:\s*[^v]*v(?<VERSION>\d+(\.\d+){1,2})' $zipSha1Regex = '<b>Without Installer \(ZIP\):</b>\s*(?<SHA1>[0-9a-fA-F]{40})' $downloadUrlTemplate =...
PowerShellCorpus/Github/episource_my-chocolatey/fileseek/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
$toolsDir = "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)" $startmenu = @{ LinkName = "FileSeek" TargetPath = "$toolsDir\FileSeek\FileSeek.exe" } Install-StartMenuLink @startmenu
PowerShellCorpus/Github/episource_my-chocolatey/nirsoft-shexview/_build.ps1
_build.ps1
# Enable common parameters [CmdletBinding()] Param() Set-StrictMode -Version latest $ErrorAction = "Stop" # Import my-chocolatey config & modules . $PSScriptRoot/../_root.ps1 $startTitle = "ShellExView" $exeName = "shexview.exe" $zipUrl = "http://www.nirsoft.net/utils/shexview-x64.zip" $changes = "" ...
PowerShellCorpus/Github/episource_my-chocolatey/nirsoft-regdllview-x86/_build.ps1
_build.ps1
# Enable common parameters [CmdletBinding()] Param() Set-StrictMode -Version latest $ErrorAction = "Stop" # Import my-chocolatey config & modules . $PSScriptRoot/../_root.ps1 $startTitle = "RegDllView (x86)" $exeName = "RegDllView.exe" $zipUrl = "http://www.nirsoft.net/utils/regdllview.zip" $changelo...
PowerShellCorpus/Github/episource_my-chocolatey/extensions/conemu-task.extension/_build.ps1
_build.ps1
# Enable common parameters [CmdletBinding()] Param() # Import my-chocolatey config & modules . $PSScriptRoot/../../_root.ps1 New-Package
PowerShellCorpus/Github/episource_my-chocolatey/extensions/conemu-task.extension/extensions/remove.ps1
remove.ps1
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed...
PowerShellCorpus/Github/episource_my-chocolatey/extensions/conemu-task.extension/extensions/flags.ps1
flags.ps1
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed...
PowerShellCorpus/Github/episource_my-chocolatey/extensions/conemu-task.extension/extensions/install.ps1
install.ps1
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed...
PowerShellCorpus/Github/episource_my-chocolatey/extensions/conemu-task.extension/extensions/internals.ps1
internals.ps1
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed...
PowerShellCorpus/Github/episource_my-chocolatey/extensions/conemu-task.extension/extensions/sort.ps1
sort.ps1
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed...
PowerShellCorpus/Github/episource_my-chocolatey/extensions/conemu-task.extension/extensions/add.ps1
add.ps1
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed...
PowerShellCorpus/Github/episource_my-chocolatey/extensions/startmenu.extension/_build.ps1
_build.ps1
# Enable common parameters [CmdletBinding()] Param() # Import my-chocolatey config & modules . $PSScriptRoot/../../_root.ps1 # Format version info $versionInfo = @{ Version = "1.1.1" FileUrl = @() Checksum = @() ReleaseNotes = @" v1.1.1 - All links used to be created with "Run ...
PowerShellCorpus/Github/episource_my-chocolatey/extensions/startmenu.extension/extensions/config.ps1
config.ps1
# Copyright 2016 Philipp Serr (episource) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
PowerShellCorpus/Github/episource_my-chocolatey/extensions/shimgen.extension/_build.ps1
_build.ps1
# Enable common parameters [CmdletBinding()] Param() # Import my-chocolatey config & modules . $PSScriptRoot/../../_root.ps1 New-Package
PowerShellCorpus/Github/episource_my-chocolatey/extensions/shimgen.extension/extensions/config.ps1
config.ps1
# Copyright 2016 Philipp Serr (episource) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
PowerShellCorpus/Github/episource_my-chocolatey/extensions/regedit.extension/_build.ps1
_build.ps1
# Enable common parameters [CmdletBinding()] Param() # Import my-chocolatey config & modules . $PSScriptRoot/../../_root.ps1 New-Package
PowerShellCorpus/Github/episource_my-chocolatey/extensions/regedit.extension/extensions/import.ps1
import.ps1
# Copyright 2016 Philipp Serr (episource) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
PowerShellCorpus/Github/episource_my-chocolatey/extensions/regedit.extension/extensions/classes.ps1
classes.ps1
# Copyright 2016 Philipp Serr (episource) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
PowerShellCorpus/Github/episource_my-chocolatey/extensions/regedit.extension/extensions/image.ps1
image.ps1
# Copyright 2016 Philipp Serr (episource) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
PowerShellCorpus/Github/episource_my-chocolatey/extensions/regedit.extension/extensions/tools.ps1
tools.ps1
# Copyright 2016 Philipp Serr (episource) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
PowerShellCorpus/Github/episource_my-chocolatey/extensions/regedit.extension/extensions/install.ps1
install.ps1
#requires -version 5 # Copyright 2016 Philipp Serr (episource) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
PowerShellCorpus/Github/episource_my-chocolatey/extensions/regedit.extension/extensions/export.ps1
export.ps1
# Copyright 2016 Philipp Serr (episource) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
PowerShellCorpus/Github/vtrifonov-esfiddle_PowerShellTest/EsfQueryRunner/EsfQueryRunner.ps1
EsfQueryRunner.ps1
Function Start-EsfQueryRunner { $elasticSearch = "C:\Program Files\elasticsearch-5.1.1\" $elasticSearchConfig = "$PSScriptRoot\EsfQueryRunnerConfig\" start-process -FilePath (Resolve-Path "$elasticSearch\bin\elasticsearch.bat") -ArgumentList "-Epath.conf=$elasticSearchConfig" Start-Sleep 10 } ...
PowerShellCorpus/Github/Rinnlinn_RepositoryBuckupper/fetchAllRepos.ps1
fetchAllRepos.ps1
$AllDirectory = Get-ChildItem -Directory -Name foreach($dirName in $AllDirectory) { cd $dirName $location = Get-Location echo "$location fetch all" git fetch --all cd .. }
PowerShellCorpus/Github/renevanosnabrugge_VSTS-SetPackageQuality/Set-PackageQuality.ps1
Set-PackageQuality.ps1
param ( [ValidateSet("nuget","npm")][string] $feedType = "nuget", [string] $feedName="", [string] $packageId="", [string] $packageVersion="", [string] $packageQuality="", [switch] $pester ) #global variables $account = ($env:SYSTEM_TEAMFOUNDATIONSERVERURI -rep...
PowerShellCorpus/Github/renevanosnabrugge_VSTS-SetPackageQuality/Test-SetPackageQuality.ps1
Test-SetPackageQuality.ps1
$env:SYSTEM_TEAMFOUNDATIONSERVERURI = "https://accountname.visualstudio.com/" $env:SYSTEM_TEAMPROJECT = "TeamProjectNam" $env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI = "https://accountname.visualstudio.com/" $env:PersonalAccessToken="PAT" cd $PSScriptRoot . .\Set-PackageQuality.ps1 -pester $feedType = "nuget" $...
PowerShellCorpus/Github/tclasen_PowerShell/DC2K12R2R00T.ps1
DC2K12R2R00T.ps1
#ps1 @' PowerShell.exe do{}Until ((Test-Connection 8.8.8.8 -Quiet -Count 1)) PowerShell.exe -command "IEX (new-object Net.WebClient).DownloadString('https://raw.githubusercontent.com/tclasen/PowerShell/master/DC2K12R2R00T.ps1')" '@ | set-content C:\update.bat $id=ipconfig | where-object {$_ -match "IPv4 Address...
PowerShellCorpus/Github/rakravmca_ShoppingCartSystem/SampleWebsite/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/rakravmca_ShoppingCartSystem/SampleWebsite/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/linus123_DatabaseVersion/default.ps1
default.ps1
properties { $baseDir = resolve-path . $projectName = "MyProject" $databaseServerName = "(local)\sqlexpress" $databaseName = "VersionControlSample" $databaseScriptsPath = "$baseDir\database\mssql\$projectName\TransitionsScripts" $dbDeployExec = "$baseDir\lib\dbdeploy\dbdeploy.exe" $7zipExec = "$b...
PowerShellCorpus/Github/linus123_DatabaseVersion/psake.ps1
psake.ps1
# Helper script for those who want to run psake without importing the module. # Example: # .\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)] [string]$buildFil...
PowerShellCorpus/Github/fbodmer_Azure/Artifacts/windows-azurepowershell/InstallViaWebPICmd.ps1
InstallViaWebPICmd.ps1
<################################################################################################## Description =========== - This script does the following: - installs chocolatey. - installs webpi (webpicmd) via chocolatey. - installs specified webpi products. - Th...
PowerShellCorpus/Github/fbodmer_Azure/Artifacts/windows-azurepowershell/StartChocolatey.ps1
StartChocolatey.ps1
Param( # [ValidateNotNullOrEmpty()] $ProductId ) Function Get-TempPassword() { Param( [int]$length=10, [string[]]$sourcedata ) For ($loop=1; $loop -le $length; $loop++) { $tempPassword+=($sourcedata | GET-RANDOM) } return $tempPassword } ...
PowerShellCorpus/Github/SMishin_RefsheshSolution/RefreshGuids.ps1
RefreshGuids.ps1
param( [string]$solution ) $files = Get-ChildItem *.sln,*.csproj,*.sqlproj,AssemblyInfo.cs -recurse; Get-Content $solution | Select-String 'Project\(' | ForEach-Object { $projectParts = $_ -Split '[,=]' | ForEach-Object { $_.Trim('[ "{}]') }; $oldGuid = $projectParts[3]; $newGuid = [GU...
PowerShellCorpus/Github/MSUDenverSystemsEngineering_AutoCADCivil3D2018/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_AutoCADCivil3D2018/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_AutoCADCivil3D2018/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_AutoCADCivil3D2018/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/MSUDenverSystemsEngineering_AutoCADCivil3D2018/Tests/PSScriptAnalyzer.tests.ps1
PSScriptAnalyzer.tests.ps1
Describe 'Testing against PSScriptAnalyzer rules' { Context 'PSScriptAnalyzer Standard Rules' { $analysis = Invoke-ScriptAnalyzer -Path 'Deploy-Application.ps1' $scriptAnalyzerRules = Get-ScriptAnalyzerRule forEach ($rule in $scriptAnalyzerRules) { It "Should pass $rule" { If ($analysis.RuleName -co...
PowerShellCorpus/Github/Maflos_Final/LibraryService/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/Maflos_Final/LibraryService/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/slaet_PowerShell/PHP 7 Syntax Check/New-PHPSyntaxCheck.ps1
New-PHPSyntaxCheck.ps1
<# .SYNOPSIS Performs a Syntax Checks on all given PHP Files using php.exe .DESCRIPTION Performs a Syntax Checks on all given PHP Files using php.exe .PARAMETER Directory Directory in which the PHP Files are stored .PARAMETER PhpExe Path to the php.exe .PARAMETER LogFile Path to where the ...
PowerShellCorpus/Github/slaet_PowerShell/SONOS PowerShell Controller/PSSonosControllerPreview.ps1
PSSonosControllerPreview.ps1
#################################################################################################################### # # Name: PSSonosControlerPreview.ps1 # Author: @SimonDettling (msitproblog.com) # Version: 0.1 # Disclaimer: This Script is not extensively tested and is a Preview of what's coming. Use at your...
PowerShellCorpus/Github/slaet_PowerShell/SONOS PowerShell Controller/PSSonosControllerWithSelect.ps1
PSSonosControllerWithSelect.ps1
#################################################################################################################### # # Name: PSSonosControlerPreview.ps1 # Author: @SimonDettling (www.msitproblog.com) # changes: @mirkocolemberg # Version: 0.2 # Change-log: 6.1.16 Add the Messagebox to e...
PowerShellCorpus/Github/slaet_PowerShell/Configuration Manager - Clients At Risk E-Mail Alert/ConfigMgr_Clients_At_Risk.ps1
ConfigMgr_Clients_At_Risk.ps1
######################################################################### # # File: ConfigMgr_Clients_At_Risk.ps1 # Created: 2015-09-09 # Author: @SimonDettling (msitproblog.com) # Version: 1.0.0 # ######################################################################### # Specify your s...
PowerShellCorpus/Github/timothywarner_hybrid/sync.ps1
sync.ps1
Set-ExecutionPolicy -ExecutionPolicy Bypass -Force Update-Help -Force -ErrorAction SilentlyContinue Import-Module -Name ADSync Get-Command -Module ADSync | Format-Wide -Column 2 | Measure-Object $sched = Get-ADSyncScheduler $sched | Get-Member Set-ADSyncScheduler -CustomizedSyncCycleInterval d.HH:mm:s...
PowerShellCorpus/Github/wickedviking_hyper-ops/Install-CorePackages.ps1
Install-CorePackages.ps1
################################################################################ # # Install-HOCorePackages.ps1 # # # Installs the following: # # scoop - Windows Package Manager (Best for latest versions) # chocolatey - Windows Package Manager (More control, wider support) # Hyper-V # Git w/ Unix Tools on C...
PowerShellCorpus/Github/wickedviking_hyper-ops/environments/local-main/Setup-Tools.ps1
Setup-Tools.ps1
#install scoop https://github.com/lukesampson/scoop iex (new-object net.webclient).downloadstring('https://get.scoop.sh') #Theme Powershell, cause it's better that way scoop install 7zip git openssh concfg concfg export ~/console-backup.json concfg import solarized small scoop install pshazz
PowerShellCorpus/Github/comrade3X_AssignmentWAD/WebApplication2/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/comrade3X_AssignmentWAD/WebApplication2/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/comrade3X_AssignmentWAD/WebApplication2/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/comrade3X_AssignmentWAD/WebApplication2/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/comrade3X_AssignmentWAD/WebApplication2/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/comrade3X_AssignmentWAD/WebApplication2/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/comrade3X_AssignmentWAD/WebApplication2/packages/Microsoft.ApplicationInsights.WindowsServer.2.2.0/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) if ([System.IO.File]::Exists($project.FullName)) { function MarkItemASCopyToOutput($item) { Try { #mark it to copy if newer $item.Properties.Item("CopyToOutputDirectory").Value = 2 } Catch { write-host $_.Exception.ToString() }...
PowerShellCorpus/Github/comrade3X_AssignmentWAD/WebApplication2/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/comrade3X_AssignmentWAD/WebApplication2/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/comrade3X_AssignmentWAD/WebApplication2/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/comrade3X_AssignmentWAD/WebApplication2/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/comrade3X_AssignmentWAD/WebApplication2/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/billvinson_renamePhotos/renamePhotos.ps1
renamePhotos.ps1
param ( [string]$path ) if (!$path) { Write-Host "No path provided"; Exit; } function ConfirmMessageBox { param( [parameter(Mandatory=$False)][String]$WinTitle='Rename Photos?', [parameter(Mandatory=$False)]$MsgText='Do you want to proceed?' ) [System.Reflection.Assembly]::Lo...
PowerShellCorpus/Github/cdcdcdcdcd_WindowsSpotlightBackgrounds/SaveWindowsSpotlightLockscreenImages.ps1
SaveWindowsSpotlightLockscreenImages.ps1
$pathImageDestination = "$env:USERPROFILE\Pictures\Backgrounds"; $sourcePath = "$env:USERPROFILE\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets\" Add-Type -AssemblyName System.Drawing function Get-Image{ process { $file = $_ [Drawing.Image...
PowerShellCorpus/Github/abik11_Memrise/Save-MemriseCourse.ps1
Save-MemriseCourse.ps1
##################### # .SYNOPSIS # The Save-MemriseCourse function saves all the levels in specified course to files. # .DESCRIPTION # The Save-MemriseCourse function takes title of the given course from the given url. # It creates a directory for this course if it doesn't exist. It calls Save-MemriseLevel # f...
PowerShellCorpus/Github/abik11_Memrise/Get-MemriseLevelWords.Tests.ps1
Get-MemriseLevelWords.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' . "$here\$sut" Describe "Get-MemriseLevelWords" { $directLink = 'http://www.memrise.com/course/498649/christmas-and-easter/3/' $indirectLink = '/course/498649/christmas...
PowerShellCorpus/Github/abik11_Memrise/Save-MemriseLevel.Tests.ps1
Save-MemriseLevel.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' . "$here\$sut" Describe "Save-MemriseLevel" { It "creates a file with correct name" { $outDir = 'TestDrive:\spanish' mkdir $outDir Mock Get-Memr...
PowerShellCorpus/Github/abik11_Memrise/Get-MemriseLevelLinks.Tests.ps1
Get-MemriseLevelLinks.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' . "$here\$sut" Describe "Get-MemriseLevelLinks" { $wrongLink = 'aaa' $correctLink = 'http://www.memrise.com/course/79389/learn-basic-spanish/' Context 'Result' {...
PowerShellCorpus/Github/abik11_Memrise/Get-MemriseCourseNameFromLink.ps1
Get-MemriseCourseNameFromLink.ps1
##################### # .SYNOPSIS # The Get-MemriseCourseNameFromLink function retrives course name from given link. # .DESCRIPTION # The Get-MemriseCourseNameFromLink retrives course name from given link. It splits # given link by "/" sign and takes last element. Link doesn't have to contain domain # base nam...
PowerShellCorpus/Github/abik11_Memrise/Save-MemriseLevel.ps1
Save-MemriseLevel.ps1
##################### # .SYNOPSIS # The Save-MemriseLevel function saves words in specified level to file. # .DESCRIPTION # The Save-MemriseLevel function gets words for given level link, put them # into pairs and saves to file. File names start from 1 and are incremented # for each file. It is a good idea to ...
PowerShellCorpus/Github/abik11_Memrise/Get-MemriseLevelWords.ps1
Get-MemriseLevelWords.ps1
##################### # .SYNOPSIS # Get all words in given level of memrise course. # .DESCRIPTION # The Get-MemriseLevelWords function returns all words from given level of memrise # course. It looks for all elements with specified CSS class. It is recommended to # use default class name. Level links can be ...
PowerShellCorpus/Github/abik11_Memrise/Get-MemriseLevelLinks.ps1
Get-MemriseLevelLinks.ps1
##################### # .SYNOPSIS # Get all level links for given memrise course. # .DESCRIPTION # The Get-MemriseLevelsLinks function returns all level links for given memrise course. # It looks for HTML <a> tags with specified CSS class. It is recommended to use default # class name. It returns indirect lin...
PowerShellCorpus/Github/abik11_Memrise/Get-MemriseCourseNameFromLink.Tests.ps1
Get-MemriseCourseNameFromLink.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' . "$here\$sut" Describe "Get-MemriseCourseNameFromLink" { $link = "/course/498649/christmas-and-easter/" It "retruns course name from given link" { Get-Memrise...
PowerShellCorpus/Github/abik11_Memrise/Pair-StringLines.ps1
Pair-StringLines.ps1
##################### # .SYNOPSIS # Pair even and odd lines of given string # .DESCRIPTION # The Pair-StringLines function returns paired strings based on # the given list. It is using System.Text.StringBuilder class to # build final result. It accepts string array as well as separate # strings from pipelin...
PowerShellCorpus/Github/abik11_Memrise/Save-MemriseCourse.Tests.ps1
Save-MemriseCourse.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' . "$here\$sut" Describe "Save-MemriseCourse" { It "creates directory for each course" { $level = '/course/1098043/spanish-spain-1/1/' $outDir = 'TestDrive:...
PowerShellCorpus/Github/abik11_Memrise/Pair-StringLines.Tests.ps1
Pair-StringLines.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' . "$here\$sut" Describe "Pair-StringLines" { [string[]] $lines = @("a", "b") [System.Text.StringBuilder] $strBuilder = New-Object -TypeName System.Text.StringBuilder ...
PowerShellCorpus/Github/pmyers1969_testcode/Project Code4.ps1
Project Code4.ps1
################################################### # Create virtual machine # ISE is just awesome ise ################################################### # 0. Azure Account Details Add-AzureAccount $subName = "MPN Gold Competency" Select-AzureSubscription $subName # Azure account details automatically...
PowerShellCorpus/Github/OPSTest_E2E_Provision_1485000345378/.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/friendscottn_PersonaTest/Persona/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/friendscottn_PersonaTest/Persona/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/friendscottn_PersonaTest/Persona/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/friendscottn_PersonaTest/Persona/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/friendscottn_PersonaTest/Persona/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/friendscottn_PersonaTest/Persona/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/friendscottn_PersonaTest/Persona/packages/EntityFramework.6.1.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/friendscottn_PersonaTest/Persona/packages/EntityFramework.6.1.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/powercode_IntroToPs/functions.ps1
functions.ps1
function Get-Stuff { "I write my $($args.count) args to the pipeline:" $args } function Get-NameAge($name, $age) { [pscustomobject] @{ Name = $name Age = $age } "I write my $($args.count) args to the pipeline:" $args } function Get-NameAge1($name, $age) { [pscustomobject] @{ Name = ...
PowerShellCorpus/Github/powercode_IntroToPs/dotnet.ps1
dotnet.ps1
# static property [datetime]::Now [string] $greeting = 'Hello, World!' # method call on instance. Not that parameters are needed here $greeting.IndexOf(' ') [datetime]::new $epochStart = [datetime]::new(1970,01,01,00,00,00,[DateTimeKind]::Utc) $epochStart.AddSeconds(0x58592017) # Note difference to ...
PowerShellCorpus/Github/powercode_IntroToPs/operators.ps1
operators.ps1
function show-result($sb){"$sb = $(&$sb)"} function show-intresult([scriptblock[]]$sb) { foreach($s in $sb){ $result = & $s [pscustomobject] @{ Expression = [string] $s Binary = [Convert]::ToString($result,2) Decimal = [Convert]::ToString($result,10) ...
PowerShellCorpus/Github/powercode_IntroToPs/flowcontrol.ps1
flowcontrol.ps1
foreach ($item in $collection) { } for ($i = 1; $i -lt 99; $i++) { } while ($x -gt 0) { } do { } until ($x -gt 0) do { } while ($x -gt 0) if ($x -lt $y) { } else { }
PowerShellCorpus/Github/powercode_IntroToPs/function3.ps1
function3.ps1
class Person { [string] $Name [int] $Age Person([string] $name, [int] $age) { $this.Name = $name $this.Age = $age } } function Get-Person { [OutputType([Person])] param( [Parameter(Mandatory)] [ValidateSet('Staffan', 'Vidar', 'Arve', 'Oden')] [string] $Name, ...
PowerShellCorpus/Github/powercode_IntroToPs/data.ps1
data.ps1
# text gvim.exe D:\ws\wal\TnT\BuildLog.txt Select-String -LiteralPath D:\ws\wal\TnT\BuildLog.txt -Pattern 'frostbite\.FB_EXT_(\w+)\.ENABLE' Select-String -LiteralPath D:\ws\wal\TnT\BuildLog.txt -Pattern 'frostbite\.FB_EXT_(\w+)\.ENABLE' | Get-Member Select-String -LiteralPath D:\ws\wal\TnT\BuildLog.txt -Pa...
PowerShellCorpus/Github/powercode_IntroToPs/philo.ps1
philo.ps1
param( [int] $ThrottleLimit = 3, [int] $Milliseconds = 100 ) Import-Module PSParallel -RequiredVersion 2.2.1 class Philosofer { [string] $Name [String[]] $Traits Philosofer([string] $Name, [string[]] $Traits) { $this.Name = $Name $this.Traits = $Traits } } function new-philoso...
PowerShellCorpus/Github/powercode_IntroToPs/drives.ps1
drives.ps1
Get-PSDrive Get-Command -Noun PSDrive Get-Item ~/.gitconfig Get-ChildItem # gci Get-ChildItem $env:TNT_ROOT -Depth 2 -file -Include a* | Where-Object Name -match ^a $function:ExtendHistoryInfo #formatdata #typedata Set-Item -Path env:foo -Value 'a b c' Remove-Item env:foo Move-Item -Path A -Des...
PowerShellCorpus/Github/powercode_IntroToPs/function2.ps1
function2.ps1
function Get-Person { param( [Parameter(Mandatory)] [string] $Name, [Parameter(Mandatory)] [int] $Age) [PSCustomObject] @{ Name = $Name Age = $Age Args = $Args PSTypeName = 'Person' # Magic name } } Get-Person Staffan 22 | Get-Member Get-Person Jona...
PowerShellCorpus/Github/powercode_IntroToPs/function1.ps1
function1.ps1
function Get-Person([string] $Name, [int] $Age) { [PSCustomObject] @{ Name = $Name Age = $Age Args = $Args PSTypeName = 'Person' # Magic name } } Clear-Host Get-Person Staffan 22 | % PSTypeNames Get-Person Jonas 45 | Get-Member Get-Person -Name Staffan -Age 22 1 3 5
PowerShellCorpus/Github/powercode_IntroToPs/function5.ps1
function5.ps1
# Invoke-RestMethod -Uri http://localhost:1338/db/all | % {$_[0].psobject.properties} | % {"[{0}] `${1}" -f ($_.TypeNameOfValue -replace 'System.' -replace 'Int32', 'int').tolower(), $_.Name} class AvalancheDatabase { [string] $id [string] $root [string] $displayName [string] $stateOid [int] $sch...
PowerShellCorpus/Github/powercode_IntroToPs/commands.ps1
commands.ps1
# Object cmdlets Get-Command -Noun Object # where Get-ChildItem | Where-Object { $_.Length % 4 -eq 0 } Get-ChildItem | Where-Object Name -like p* # foreach 1..20 | ForEach-Object { [pscustomobject] @{I = $_; ISquare = $_ * $_} } Get-ChildItem | ForEach-Object Name # sort 1,4,2,6 | Sort-Object -Des...
PowerShellCorpus/Github/powercode_IntroToPs/expressions.ps1
expressions.ps1
# int32 42 # int64 564897987465 # decimal 3213216546549879847651 # String 'Hello' # variable $someone = 'World' # String with variable expansion "Hello, $someone" # Array @(1,2,3) 'a', 'b', 'c' # Hashtable @{ Product = 'Walrus' TD = 'Jonas' Devs = 35 } $true, $false ...