full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/SerkanDevrim_soruSor/soruSor.servis/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/kentstanton_AdkHistoryGIS/scripts/AssetManagement/init-assetstorage.ps1
init-assetstorage.ps1
<# .Synopsis init-assetstorage - Create folders and database structures for storing and managing field work assets .DESCRIPTION Forest assessment trips commonly yield valuable assets in addition to protocol based datasets. For example, images, video, GPS track logs, etc. Storing these assets in a c...
PowerShellCorpus/Github/aaronmlucas_LogShipper/LogShipper.ps1
LogShipper.ps1
################################# ### Filename : LogShipper.ps1 ### Version : 1.02 ### Date : 10/7/2014 ### Author : Alucas ################################# ######################################################################################################################### ####################...
PowerShellCorpus/Github/rchaganti_DemoRepo/testdemo.ps1
testdemo.ps1
#Hello, world!
PowerShellCorpus/Github/rchaganti_DemoRepo/testaademo.ps1
testaademo.ps1
#Just a comment
PowerShellCorpus/Github/rchaganti_DemoRepo/test.ps1
test.ps1
#This is just a comment
PowerShellCorpus/Github/rchaganti_DemoRepo/testaawhdemo.ps1
testaawhdemo.ps1
#Comment
PowerShellCorpus/Github/staxmanade_PowerShellPresentation/TimeTracker.ps1
TimeTracker.ps1
<# Start-TrackingTime 90 HowsMyTime "some topic" #> $timeTracker = @{} function Start-TrackingTime($allottedMinutes) { $timeTracker.StartTime = Get-Date $timeTracker.Tick = get-date $timeTracker.ExpectedEndTime = $timeTracker.StartTime.AddMinutes($allottedMinutes) Writ...
PowerShellCorpus/Github/staxmanade_PowerShellPresentation/HelloFromAScript.ps1
HelloFromAScript.ps1
echo "Hello from a .ps1 script" if( $args ) { $args }
PowerShellCorpus/Github/cesarlarag_automationPS/number1.ps1
number1.ps1
function DisplayNumber () { Write-Host "please enter a number" $num = Read-Host Write-Host "your number is " $num $rand= Get-Random -Minimum 0 -Maximum $num Write-Host "random number is " $rand } DisplayNumber if( $num -gt $ran) { Write-Host "I win" } else { Write-Host "you win" ...
PowerShellCorpus/Github/cesarlarag_automationPS/testprogress.ps1
testprogress.ps1
#launches Notepad Notepad #Setup a do while loop that does nothing while property value is True. do { write-host "." } While (get-process notepad | select -Property Responding) #Code to run when loop stops (when notepad is closed) $strTime = get-date Write-Host “The Application Notepad failed to respond on: $s...
PowerShellCorpus/Github/cesarlarag_automationPS/searchwordfile.ps1
searchwordfile.ps1
$application = New-Object -comobject word.application #$application.visible = $false $document = $application.documents.open("C:\temp\testdoc.docx") $selection = $application.Selection $words = "Intel Confidential" $matchCase = $false $matchWholeWord = $true $matchWildCards = $false $matchSoundsLike = $false $...
PowerShellCorpus/Github/cesarlarag_automationPS/numeros-mayor.ps1
numeros-mayor.ps1
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | Out-Null function DisplayNumber () { $objForm = New-Object System.Windows.Forms.Form $objForm.Text = "Let's play" $objForm.Size = New-Object System....
PowerShellCorpus/Github/cesarlarag_automationPS/pingmuchos.ps1
pingmuchos.ps1
#### Provide the computer name in $computername variable $ServerName = Get-Content "c:\Users\clara1\Desktop\hosts.txt" ##### Script Starts Here ###### foreach ($Server in $ServerName) { if (test-Connection -ComputerName $Server -Count 2 -Quiet ) { write-Host "$Se...
PowerShellCorpus/Github/cesarlarag_automationPS/input.ps1
input.ps1
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") $objForm = New-Object System.Windows.Forms.Form $objForm.Text = "Data Entry Form" $objForm.Size = New-Object System.Drawing.Size(300,200) $objForm.StartP...
PowerShellCorpus/Github/cesarlarag_automationPS/number.ps1
number.ps1
function DisplayNumber () { Write-Host "please enter a number" $num = Read-Host Write-Host "your number is " $num $rand= Get-Random -Minimum 0 -Maximum $num Write-Host "random number is " $rand } function prompt(){ $usr =$env:username $mach = $env:COMPUTERNAME $(if (test-path variable:/...
PowerShellCorpus/Github/filipino-inquisitor_Ansible/WebDeployIIS/create_folder_web.ps1
create_folder_web.ps1
# script to create folders for ANSIBLE POC New-Item C:\sites\oakgov\ PowerShell -type directory New-Item C:\sites\logs PowerShell -type directory # end of script
PowerShellCorpus/Github/filipino-inquisitor_Ansible/Snapshot/Snapshot.ps1
Snapshot.ps1
Param( [string]$access, [string]$secret) New-EC2Snapshot -VolumeID vol-0fd39a57fccae6e2a -Description "Snapshot created Date" -Region us-east-1 -SecretKey $secret -AccessKey $access
PowerShellCorpus/Github/piwi82_VPN-route/Windows/vpn-route.ps1
vpn-route.ps1
# # Known bugs # ---------- # # The interface name in the Event viewer message is not updated when the interface has been renamed # # # Task scheduler configuration # ---------------------------- # # Trigger on event # Log : Microsoft-Windows-NetworkProfile/Operational # Source : NetworkP...
PowerShellCorpus/Github/nerdshark_windows-dotfiles/powershell/theme.ps1
theme.ps1
Import-Module "$PSScriptRoot\Get-AdminStatus" $pathsToAddToPath = @("C:\Program Files (x86)\Git\bin", "C:\chocolatey\bin") foreach ($path in $pathsToAddToPath) { if ($env:Path -notlike "*" + $path + "*") { $env:Path += ";" $env:Path += $path } } Import-Module "$PSScriptRoot\posh-git" #. "$PSScri...
PowerShellCorpus/Github/nerdshark_windows-dotfiles/powershell/prompt.ps1
prompt.ps1
Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent) # Load posh-git module from current directory Import-Module .\posh-git # If module is installed in a default location ($env:PSModulePath), # use this instead (see about_Modules for more information): # Import-Module posh-git # Set...
PowerShellCorpus/Github/nerdshark_windows-dotfiles/powershell/powershell-ise-solarized/Solarize-PSISE-AddOnMenu.ps1
Solarize-PSISE-AddOnMenu.ps1
<# .SYNOPSIS Companion script to Solarize-PSISE. Running this script creates Add-on menu entries in PowerShell ISE for applying Solarized palette colors. .DESCRIPTION Companion script to Solarize-PSISE. Running this script creates Add-on menu entries in PowerShell ISE for applying Solarized palette colors. U...
PowerShellCorpus/Github/nerdshark_windows-dotfiles/powershell/powershell-ise-solarized/Solarize-PSISE.ps1
Solarize-PSISE.ps1
<# From http://ethanschoonover.com/solarized#usage-development Base colors: base03 #002b36 base02 #073642 base01 #586e75 base00 #657b83 base0 #839496 base1 #93a1a1 base2 #eee8d5 base3 #fdf6e3 The base colors are chosen depending upon the light or dark theme. base*3 backgrou...
PowerShellCorpus/Github/nerdshark_windows-dotfiles/powershell/posh-git/TortoiseGit.ps1
TortoiseGit.ps1
# TortoiseGit function private:Get-TortoiseGitPath { if ((Test-Path "C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe") -eq $true) { # TortoiseGit 1.8.0 renamed TortoiseProc to TortoiseGitProc. return "C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe" } return "C:\Program Files\Tortoise...
PowerShellCorpus/Github/nerdshark_windows-dotfiles/powershell/posh-git/CheckVersion.ps1
CheckVersion.ps1
$Global:GitMissing = $false if (!(Get-Command git -TotalCount 1 -ErrorAction SilentlyContinue)) { Write-Warning "git command could not be found. Please create an alias or add it to your PATH." $Global:GitMissing = $true return } $requiredVersion = [Version]'1.7.2' if ((git --version 2> $null) -ma...
PowerShellCorpus/Github/nerdshark_windows-dotfiles/powershell/posh-git/Utils.ps1
Utils.ps1
# General Utility Functions function Invoke-NullCoalescing { $result = $null foreach($arg in $args) { if ($arg -is [ScriptBlock]) { $result = & $arg } else { $result = $arg } if ($result) { break } } $result } Set-Alias ?? Invoke-N...
PowerShellCorpus/Github/nerdshark_windows-dotfiles/powershell/posh-git/GitPrompt.ps1
GitPrompt.ps1
# Inspired by Mark Embling # http://www.markembling.info/view/my-ideal-powershell-prompt-with-git-integration $global:GitPromptSettings = New-Object PSObject -Property @{ DefaultForegroundColor = $Host.UI.RawUI.ForegroundColor BeforeText = ' [' BeforeForegroundColor = [Console...
PowerShellCorpus/Github/nerdshark_windows-dotfiles/powershell/posh-git/GitUtils.ps1
GitUtils.ps1
# Inspired by Mark Embling # http://www.markembling.info/view/my-ideal-powershell-prompt-with-git-integration function Get-GitDirectory { if ($Env:GIT_DIR) { $Env:GIT_DIR } else { Get-LocalOrParentPath .git } } function Get-GitBranch($gitDir = $(Get-GitDirectory), [Diagnostics.S...
PowerShellCorpus/Github/nerdshark_windows-dotfiles/powershell/posh-git/profile.example.ps1
profile.example.ps1
Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent) # Load posh-git module from current directory Import-Module .\posh-git # If module is installed in a default location ($env:PSModulePath), # use this instead (see about_Modules for more information): # Import-Module posh-git # Set...
PowerShellCorpus/Github/nerdshark_windows-dotfiles/powershell/posh-git/install.ps1
install.ps1
param([switch]$WhatIf = $false) if($PSVersionTable.PSVersion.Major -lt 2) { Write-Warning "posh-git requires PowerShell 2.0 or better; you have version $($Host.Version)." return } if(!(Test-Path $PROFILE)) { Write-Host "Creating PowerShell profile...`n$PROFILE" New-Item $PROFILE -Force -Type ...
PowerShellCorpus/Github/nerdshark_windows-dotfiles/powershell/posh-git/GitTabExpansion.ps1
GitTabExpansion.ps1
# Initial implementation by Jeremy Skinner # http://www.jeremyskinner.co.uk/2010/03/07/using-git-with-windows-powershell/ $Global:GitTabSettings = New-Object PSObject -Property @{ AllCommands = $false } $subcommands = @{ bisect = 'start bad good skip reset visualize replay log run' notes = 'edit ...
PowerShellCorpus/Github/yzxandfcm_SQLiteDemo/Entity Framework/packages/System.Data.SQLite.EF6.1.0.98.1/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/yzxandfcm_SQLiteDemo/Entity Framework/packages/System.Data.SQLite.EF6.1.0.98.1/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/yzxandfcm_SQLiteDemo/Entity Framework/packages/System.Data.SQLite.EF6.1.0.98.1/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/yzxandfcm_SQLiteDemo/Entity Framework/packages/System.Data.SQLite.EF6.1.0.98.1/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/yzxandfcm_SQLiteDemo/Entity Framework/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/yzxandfcm_SQLiteDemo/Entity Framework/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/sethjuarez_FastDoc/Build/clean.ps1
clean.ps1
# Set Path $sourceDir = resolve-path .. Write-Host "Searching $sourceDir" # Define files and directories to delete $include = @("bin", "obj", "Release", "Working", "packages", "TestResults", ".vs", "*.suo", "*.user", "*.orig", "*.dat", "*.lock.json", "*.nuget.props", "*.nuget.targets") Write-Host -ForegroundCo...
PowerShellCorpus/Github/sethjuarez_FastDoc/Build/build.ps1
build.ps1
properties { $majorVersion = "1.0" $majorWithReleaseVersion = "1.0.0" $version = GetVersion $majorWithReleaseVersion $name = "FastDoc" $treatWarningsAsErrors = $true $workingName = if ($workingName) {$workingName} else {"Working"} $baseDir = resolve-path .. $buildDir = "$baseDir\Build" $sourceDir = "...
PowerShellCorpus/Github/milesdevis_Internship_2.0/Internship_2/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/milesdevis_Internship_2.0/Internship_2/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/milesdevis_Internship_2.0/Internship_2/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/milesdevis_Internship_2.0/Internship_2/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/milesdevis_Internship_2.0/Internship_2/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/milesdevis_Internship_2.0/Internship_2/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/milesdevis_Internship_2.0/Internship_2/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/milesdevis_Internship_2.0/Internship_2/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/milesdevis_Internship_2.0/Internship_2/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/paulomarquesc_AzurePowerShellSampleDeployment/Powershell-PoC-Environment-Setup.ps1
Powershell-PoC-Environment-Setup.ps1
#Requires -Version 5.0 <# .SYNOPSIS POC-Environment-Setup.ps1 - Script that configures the PoC environment for Azure Fast Start for IaaS. .DESCRIPTION POC-Environment-Setup.ps1 - Script that configures the PoC environment for Azure Fast Start for IaaS. This script configures all necessary resources to ha...
PowerShellCorpus/Github/vivekpatil_Technical-Assessments/VideoStore/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/vivekpatil_Technical-Assessments/VideoStore/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/vivekpatil_Technical-Assessments/VideoStore/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/vivekpatil_Technical-Assessments/VideoStore/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/vivekpatil_Technical-Assessments/VideoStore/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/vivekpatil_Technical-Assessments/VideoStore/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/vivekpatil_Technical-Assessments/VideoStore/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/vivekpatil_Technical-Assessments/VideoStore/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/vivekpatil_Technical-Assessments/VideoStore/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/vivekpatil_Technical-Assessments/VideoStore/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/vivekpatil_Technical-Assessments/VideoStore/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/MattPaul25_PowerShell/Sdm_DeleteBAK.ps1
Sdm_DeleteBAK.ps1
$address = 'U:/MSSQL11.MSSQLSERVER/MSSQL/Backup/SFTP_Clients/virpindmisdb01/encrypted' cd $address $newFile = $address + '/SDM.BAK' #deleting BAK file because no longer encrypted If (Test-Path $newFile){ Remove-Item $newFile } #deleting log file due to size constraints $logAddress = 'U:/MSSQL11.MSSQLS...
PowerShellCorpus/Github/MattPaul25_PowerShell/Sdm_Prepare.ps1
Sdm_Prepare.ps1
$address = 'U:/MSSQL11.MSSQLSERVER/MSSQL/Backup/SFTP_Clients/virpindmisdb01/encrypted' cd $address $oldFile = $address + '/SDM.BAK.Encrypted' $newFile = $address + '/SDM.BAK' If (Test-Path $newFile){ Remove-Item $newFile } get-childitem | % { rename-item $_ "SDM.BAK.Encrypted"} u:\sfile.exe ks-dec $old...
PowerShellCorpus/Github/MattPaul25_PowerShell/UniversalTool_DeleteBak.ps1
UniversalTool_DeleteBak.ps1
#runs after the restore #deletes the flat file after the restoration happens so no non encrypted data is on there $address = 'U:/MSSQL11.MSSQLSERVER/MSSQL/Backup/SFTP_Clients/sbkfisdb9/encrypted' $newFile = $address + '/UniversalTool.BAK' If (Test-Path $newFile){ Remove-Item $newFile }
PowerShellCorpus/Github/MattPaul25_PowerShell/Universaltool_Prepare.ps1
Universaltool_Prepare.ps1
$address = 'U:/MSSQL11.MSSQLSERVER/MSSQL/Backup/SFTP_Clients/sbkfisdb9/encrypted' cd $address $oldFile = $address + '/UniversalTool.BAK.Encrypted' $newFile = $address + '/UniversalTool.BAK' If (Test-Path $newFile){ Remove-Item $newFile } get-childitem | % { rename-item $_ "UniversalTool.BAK.Encrypted"} ...
PowerShellCorpus/Github/rafael151_ProjetoTeste/AplicacaoDeTestes/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/rafael151_ProjetoTeste/AplicacaoDeTestes/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/Hindy-UK_dc2-test/ActiveDirectoryProdTest.ps1
ActiveDirectoryProdTest.ps1
configuration ActiveDirectoryProdTest { param ( [Parameter(Mandatory)] [String]$DomainName, [Parameter(Mandatory)] [String]$DomainNetbiosName, [Parameter(Mandatory)] [System.Management.Automation.PSCredential]$Domaincreds, [Parameter(Mandato...
PowerShellCorpus/Github/Hindy-UK_dc2-test/DeployDomainControllerSingleLocation.ps1
DeployDomainControllerSingleLocation.ps1
# Variables $currentTime = Get-Date -Format filedatetime $ukwResourceGroupName = 'ADProdUkwRg' $domainControllerTemplateFile = 'https://raw.githubusercontent.com/Hindy-UK/dc2-test/master/azuredeploy.json' $parameters = @{} $parameters.Add("timestamp", $currentTime) # ------------------------------------------...
PowerShellCorpus/Github/Hindy-UK_dc2-test/CompileActiveDirectoryProd.ps1
CompileActiveDirectoryProd.ps1
$ConfigData = @{ AllNodes = @( @{ NodeName = "*" PSDscAllowPlainTextPassword = $True } @{ NodeName = "PhitDC2ProdUkw" Role = “AdditionalDomainController” DnsServerAddress = @( '10.1.13.4' '127.0.0.1' ) SiteName = 'PhitProdAzu...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/Default.ps1
Default.ps1
## Default PSake build script [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost', '')] param() #requires -Version 5; #requires -Modules VirtualEngine.Build; $psake.use_exit_on_error = $true; Properties { $moduleName = (Get-Item $PSScriptRoot\*.psd1)[0].BaseName; $baseP...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/Src/Import-ROWBuildingBlock.ps1
Import-ROWBuildingBlock.ps1
function Import-ROWBuildingBlock { <# .SYNOPSIS Imports a RES ONE Workspace building block. .EXAMPLE Import-ROWBuildingBlock -Path .\RESWM.xml Imports the 'RESWM.xml' building block into the RES ONE Workspace database using the current Windows user credentials. .EXA...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/Src/Export-ROWBuildingBlock.ps1
Export-ROWBuildingBlock.ps1
function Export-ROWBuildingBlock { <# .SYNOPSIS Exports a RES ONE Workspace building block. .EXAMPLE Export-ROWBuildingBlock -Path .\RESWM.xml Exports the entire RES ONE Workspace environment into the 'RESWM.xml' building block file. .EXAMPLE Export-ROWBuildingBlock...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/Src/New-ROWManagementPortalConfiguration.ps1
New-ROWManagementPortalConfiguration.ps1
function New-ROWManagementPortalConfiguration { <# .SYNOPSIS Creates a RES ONE Workspace Management Portal web configuration file. #> [CmdletBinding(SupportsShouldProcess, DefaultParameterSetName = 'WindowsAuthentication')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldPro...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/DSCResources/ROWCommon/Src/Get-ROWErrorCode.ps1
Get-ROWErrorCode.ps1
function Get-ROWErrorCode { <# .SYNOPSIS Resolves a RES ONE Workspace console exit error code to a string. #> [CmdletBinding()] [OutputType([System.String])] param ( ## PWRTECH.EXE exit code to resolve to a string [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelin...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/DSCResources/ROWCommon/Src/Get-ROWComponentInstallPath.ps1
Get-ROWComponentInstallPath.ps1
function Get-ROWComponentInstallPath { <# .SYNOPSIS Resolves the installation directory of the specified RES ONE Workspace component. #> [CmdletBinding()] [OutputType([System.String])] param ( [Parameter(Mandatory)] [ValidateSet('Agent','Console','RelayServer','Reporting...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/DSCResources/ROWCommon/Src/Assert-ROWComponent.ps1
Assert-ROWComponent.ps1
function Assert-ROWComponent { <# .SYNOPSIS Ensures that the RES ONE Workspace component is installed. #> [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateSet('Agent','Console','RelayServer')] [System.String] $Component ) process { if (-...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/DSCResources/ROWCommon/Src/Import-ROWBuildingBlockFile.ps1
Import-ROWBuildingBlockFile.ps1
function Import-ROWBuildingBlockFile { <# .SYNOPSIS Import a RES ONE Workspace building block. #> [CmdletBinding(DefaultParameterSetName = 'Path')] [OutputType([System.Management.Automation.PSCustomObject])] param ( # Specifies a path to one or more locations. Wildcards are permi...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/DSCResources/ROWCommon/Src/Save-ROWManagementPortalConfiguration.1.ps1
Save-ROWManagementPortalConfiguration.1.ps1
function Save-ROWManagementPortalConfiguration { <# .SYNOPSIS Writes a RES ONE Workspace Management Portal web configuration file. #> [CmdletBinding(SupportsShouldProcess, DefaultParameterSetName = 'WindowsAuthentication')] param ( ## Path to RES ONE Workspace Management Portal web co...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/DSCResources/ROWCommon/Src/Get-WindowsInstallerPackageProperty.ps1
Get-WindowsInstallerPackageProperty.ps1
function Get-WindowsInstallerPackageProperty { <# .SYNOPSIS This cmdlet retrieves product name from a Windows Installer MSI database. .DESCRIPTION This function uses the WindowInstaller COM object to pull all values from the Property table from a MSI package. .NOTES Adapted fr...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/DSCResources/ROWCommon/Src/Start-WaitProcess.ps1
Start-WaitProcess.ps1
function Start-WaitProcess { <# .SYNOPSIS Starts and waits for a process to exit. .NOTES This is an internal function and shouldn't be called from outside. #> [CmdletBinding(SupportsShouldProcess)] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess', '')] ...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/DSCResources/ROWCommon/Src/Register-PInvoke.ps1
Register-PInvoke.ps1
function Register-PInvoke { <# .NOTES Kindly donated by Micorsoft from: https://github.com/PowerShell/xPSDesiredStateConfiguration/blob/564bfba5bb0114623a334e1c7a8842b4996e05a6/DSCResources/MSFT_xPackageResource/MSFT_xPackageResource.psm1 #> [CmdletBinding()] param ( ) process { ...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/DSCResources/ROWCommon/Src/Get-ROWConsolePath.ps1
Get-ROWConsolePath.ps1
function Get-ROWConsolePath { <# .SYNOPSIS Returns the RES ONE Workspace console path. #> [CmdletBinding()] [OutputType([System.String])] param ( ) begin { Assert-ROWComponent -Component 'Console'; } process { $pwrtechRootPath = Get-ROWComponentInsta...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/DSCResources/ROWCommon/Src/Export-ROWBuildingBlockFile.ps1
Export-ROWBuildingBlockFile.ps1
function Export-ROWBuildingBlockFile { <# .SYNOPSIS Exports a RES ONE Workspace building block. .EXAMPLE Export-ROWBuildingBlock -Path .\RESWM.xml Exports the entire RES ONE Workspace environment into the 'RESWM.xml' building block file. .EXAMPLE Export-ROWBuildingB...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/DSCResources/ROWCommon/Src/Get-InstalledProductEntry.ps1
Get-InstalledProductEntry.ps1
function Get-InstalledProductEntry { <# .NOTES https://github.com/PowerShell/xPSDesiredStateConfiguration/blob/dev/DSCResources/MSFT_xPackageResource/MSFT_xPackageResource.psm1 #> [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( [Parameter()] [Valid...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/DSCResources/ROWCommon/Src/Get-RegistryValueIgnoreError.ps1
Get-RegistryValueIgnoreError.ps1
function Get-RegistryValueIgnoreError { <# .NOTES https://github.com/PowerShell/xPSDesiredStateConfiguration/blob/dev/DSCResources/MSFT_xPackageResource/MSFT_xPackageResource.psm1 #> param ( [Parameter(Mandatory)] [Microsoft.Win32.RegistryHive] $RegistryHive, [Paramet...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/DSCResources/ROWCommon/Src/Get-LocalizableRegistryKeyValue.ps1
Get-LocalizableRegistryKeyValue.ps1
function Get-LocalizableRegistryKeyValue { <# .NOTES https://github.com/PowerShell/xPSDesiredStateConfiguration/blob/dev/DSCResources/MSFT_xPackageResource/MSFT_xPackageResource.psm1 #> [CmdletBinding()] param ( [Parameter()] [System.Object] $RegistryKey, [Paramete...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/DSCResources/ROWCommon/Src/Resolve-ROWPackagePath.ps1
Resolve-ROWPackagePath.ps1
function Resolve-ROWPackagePath { <# .SYNOPSIS Resolves the latest RES ONE Workspace/Workspace Manager installation package. #> [CmdletBinding()] param ( ## The literal file path or root search path [Parameter(Mandatory)] [System.String] $Path, ## Required...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/Examples/RESONEWorkspaceLabExample.ps1
RESONEWorkspaceLabExample.ps1
$config = @{ AllNodes = @( @{ NodeName = 'localhost'; PSDSCAllowPlainTextPassword = $true; ROWDatabaseServer = 'controller.lab.local'; ROWDatabaseName = 'RESONEWorkspace'; ROWBinariesFolder = 'C:\SharedData\Software\RES\ONE Worksapce ...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/Tests/Unit/DSCResources/ROWCommon/Src/Resolve-ROWPackagePath.Tests.ps1
Resolve-ROWPackagePath.Tests.ps1
## Import the ROACommon module $moduleRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..\..\DSCResources\ROWCommon\ROWCommon.psd1").Path; Import-Module $moduleRoot -Force; Describe 'RESONEWorkspace\ROWCommon\Resolve-ROWPackagePath' { It 'Should resolve 2016 (v9.12) Full Agent installer' { $v...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/Tests/Integration/VE_ROWManagementPortal.Integration.Tests.ps1
VE_ROWManagementPortal.Integration.Tests.ps1
$script:DSCModuleName = Split-Path -Path "$PSScriptRoot\..\.." -Resolve -Leaf; $script:DSCResourceName = (Get-Item -Path $MyInvocation.MyCommand.Path).BaseName -replace '\.Integration\.Tests',''; #region HEADER # Integration Test Template Version: 1.1.1 [System.String] $script:moduleRoot = Split-Path -Parent (Spl...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/Tests/Integration/RESONEWorkspace.Integration.Tests.ps1
RESONEWorkspace.Integration.Tests.ps1
Describe 'Integration\RESONEWorkspace' { It 'Should load module without throwing' { $repoRoot = (Resolve-Path "$PSScriptRoot\..\..").Path; $moduleName = (Get-Item -Path $repoRoot).Name; { Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psd1") -Force } | Should Not ...
PowerShellCorpus/Github/VirtualEngine_RESONEWorkspace/Tests/Integration/VE_ROWManagementPortal.Config.ps1
VE_ROWManagementPortal.Config.ps1
configuration VE_ROWManagementPortal_Config { param ( ## IIS website host header/name, i.e. res.lab.local. [Parameter(Mandatory)] [System.String] $HostHeader, ## File path containing the RES ONE Workspace MSIs or the literal path to the management portal MSI. [...
PowerShellCorpus/Github/candale_Jack-s-Retarded-Code/ITEC/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/candale_Jack-s-Retarded-Code/ITEC/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/jeffpatton1971_SchannelManagement/SchannelManagement/SchannelManagement.tests.ps1
SchannelManagement.tests.ps1
# # This is a PowerShell Unit Test file. # You need a unit test framework such as Pester to run PowerShell Unit tests. # You can download Pester from http://go.microsoft.com/fwlink/?LinkID=534084 # Describe "Get-Function" { Context "Function Exists" { It "Should Return" { } } }
PowerShellCorpus/Github/jeffpatton1971_SchannelManagement/SchannelManagement/Disable-SSLv3.ps1
Disable-SSLv3.ps1
param ( [string]$ComputerName, [switch]$Client ) try { $ErrorActionPreference = 'Stop'; $Error.Clear(); $Protocols = @(); $Protocols += 'TLS 1.1'; $Protocols += 'TLS 1.2'; $Protocols += 'SSL 3.0'; $Protocols += 'PCT 1.0'; $Protocols += 'SSL 2.0'; $Protocols += 'TLS 1.0'; $Protocols |ForE...
PowerShellCorpus/Github/jeffpatton1971_SchannelManagement/SchannelManagement/KeyExchange/KeyExchange.tests.ps1
KeyExchange.tests.ps1
# # This is a PowerShell Unit Test file. # You need a unit test framework such as Pester to run PowerShell Unit tests. # You can download Pester from http://go.microsoft.com/fwlink/?LinkID=534084 # Describe "Get-Function" { Context "Function Exists" { It "Should Return" { } } }
PowerShellCorpus/Github/jeffpatton1971_SchannelManagement/SchannelManagement/Hashes/Hashes.tests.ps1
Hashes.tests.ps1
# # This is a PowerShell Unit Test file. # You need a unit test framework such as Pester to run PowerShell Unit tests. # You can download Pester from http://go.microsoft.com/fwlink/?LinkID=534084 # Describe "Get-Function" { Context "Function Exists" { It "Should Return" { } } }
PowerShellCorpus/Github/jeffpatton1971_SchannelManagement/SchannelManagement/Ciphers/Ciphers.tests.ps1
Ciphers.tests.ps1
# # This is a PowerShell Unit Test file. # You need a unit test framework such as Pester to run PowerShell Unit tests. # You can download Pester from http://go.microsoft.com/fwlink/?LinkID=534084 # Describe "Get-Function" { Context "Function Exists" { It "Should Return" { } } }
PowerShellCorpus/Github/jeffpatton1971_SchannelManagement/SchannelManagement/Protocols/Protocols.tests.ps1
Protocols.tests.ps1
# # This is a PowerShell Unit Test file. # You need a unit test framework such as Pester to run PowerShell Unit tests. # You can download Pester from http://go.microsoft.com/fwlink/?LinkID=534084 # Describe "Get-Function" { Context "Function Exists" { It "Should Return" { } } }