full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/IonutEnache21_EF/Personal_IE/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/adamhunting_A9/FastFood/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/adamhunting_A9/FastFood/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/ankh2054_Powershell/list_disabled-users_delete_directories.ps1
list_disabled-users_delete_directories.ps1
# Show a list of disabled users and then delete their home directories Get-ADUser -filter 'enabled -eq $false' -properties Name, homedirectory -SearchBase "OU=Avanta_UK,OU=_Avanta_Group,DC=avanta,DC=co,DC=uk" | % { Write-Host ("Removing homdir for:" + $_.Name + ",path:" + $_.homedirectory) rm -Force -Recurse $_.home...
PowerShellCorpus/Github/ankh2054_Powershell/clen_temp_internet_files.ps1
clen_temp_internet_files.ps1
$localServerName = Get-WmiObject -Class Win32_ComputerSystem | Select Name foreach($disk in gwmi win32_logicaldisk -ComputerName $localServerName.Name | where {$_.drivetype -eq 3} | select caption,size,freespace) { If($hour -gt 7 -or $hour -lt 19){ $Output = "Not set to execute during office hours " } Else{ ...
PowerShellCorpus/Github/ankh2054_Powershell/archivemanager_optimize.ps1
archivemanager_optimize.ps1
Get-Service | where {$_.name -eq 'Archive Full Text Index Service'} | Stop-Service -Force while((Get-Service | where {$_.name -eq 'Archive Full Text Index Service'}).status -ne 'stopped') { sleep -Seconds 1 Write-Host "Busy stopping Service...." } Write-Host 'Archive Full Text Index Service stopped' ...
PowerShellCorpus/Github/ankh2054_Powershell/clean_temp_internet_files.ps1
clean_temp_internet_files.ps1
$localServerName = Get-WmiObject -Class Win32_ComputerSystem | Select Name foreach($disk in gwmi win32_logicaldisk -ComputerName $localServerName.Name | where {$_.drivetype -eq 3} | select caption,size,freespace) { If($hour -gt 7 -or $hour -lt 19){ $Output = "Not set to execute during office hours " } Else{ ...
PowerShellCorpus/Github/ankh2054_Powershell/mount_exchange_databases.ps1
mount_exchange_databases.ps1
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin $localServerName = Get-WmiObject -Class Win32_ComputerSystem | Select Name [int]$hour = get-date -format HH $DBS = Get-MailboxDatabase -Status -Server $localServerName.Name | Select Server,Name,Mounted | where {$_.Server -eq $localServerName.Name} foreac...
PowerShellCorpus/Github/ankh2054_Powershell/largest_file_search.ps1
largest_file_search.ps1
###################################################################### # # This script will find the 25 (default) largest files and then list the # folders sizes of the c:\ drive (default). The results will be written to a # formatted text file. At the end of the script is an option to scan and list # the size of ...
PowerShellCorpus/Github/ankh2054_Powershell/archivemanager_retention.ps1
archivemanager_retention.ps1
& "C:\Program Files (x86)\Quest Software\ArchiveManager\Archive Message Retention Policy Service.exe" -ns -console -runonc
PowerShellCorpus/Github/ankh2054_Powershell/move_computers_correct_OU.ps1
move_computers_correct_OU.ps1
############################################################################### # PowerShell routine to move Windows 7 Computers into OU structure based on IP # ################################################################################ # Requires Active Directory 2008 R2 and the PowerShell ActiveDirectory m...
PowerShellCorpus/Github/ankh2054_Powershell/mailshot.ps1
mailshot.ps1
# Script will import details from list.csv and input into html email and send. See email.html and list.csv. $html = (Get-Content .\email.html) Import-Csv .\list.csv | ForEach-Object { Send-MailMessage -SmtpServer 10.1.1.26 -Subject "Logon details" -From charles@avanta.co.uk -To $_.email -Priority: High -BodyAs...
PowerShellCorpus/Github/imagej_chocolatey-packages/imagej/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
$tools = Split-Path $MyInvocation.MyCommand.Definition $package = Split-Path $tools $imagej = Join-Path $package 'ImageJ' $target = Join-Path $imagej 'ImageJ.exe' $shortcut = Join-Path ([System.Environment]::GetFolderPath('CommonPrograms')) 'ImageJ.lnk' Install-ChocolateyZipPackage ` -PackageName 'imagej' `...
PowerShellCorpus/Github/hildabarbara_ProjetosSharepointDev/BaseAssinantes/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/hildabarbara_ProjetosSharepointDev/BaseAssinantes/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/hildabarbara_ProjetosSharepointDev/BaseAssinantes/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/hildabarbara_ProjetosSharepointDev/BaseAssinantes/packages/Newtonsoft.Json.6.0.8/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) # open json.net splash page on package install # don't open if json.net is installed as a dependency try { $url = "http://james.newtonking.com/json/install?version=" + $package.Version $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) if ($dte2.ActiveWin...
PowerShellCorpus/Github/BrendanSturges_getADUserID/getADUserID.ps1
getADUserID.ps1
Function Get-FileName($initialDirectory){ [System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null $OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog $OpenFileDialog.initialDirectory = $initialDirectory $OpenFileDialog.filter = "All files (*.*)| *.*" $OpenFileDialo...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/SSH-Sessions/load-SSH.ps1
load-SSH.ps1
Import-Module .\SSH-Sessions get-help *ssh*
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/PSHELL profile/Microsoft.PowerShell_profile.ps1
Microsoft.PowerShell_profile.ps1
."C:/Program Files (x86)/VMware/Infrastructure/PowerCLI/Scripts/Initialize-PowerCLIEnvironment.ps1" Import-Module PureStoragePowerShellSDK Import-Module PureStoragePowerShellToolkit Import-Module Cisco.IMC Import-Module Cisco.UCS.Core Import-Module Cisco.UCS.DesiredStateConfiguration Import-Module Cisco.UCSManage...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/CFG-add-vlans.ps1
CFG-add-vlans.ps1
##### # Load input files # CSV-VLANlist ##### Import-module .\demoVars.psm1 $listVLAN=Import-CSV $workDir"CSV-VLAN-list.csv" $listSW=Import-CSV $workDir"CSV-LANSW-list.csv" echo-inprogress "Adding VLANs to switches" foreach($tmpsw in $listSW) { $tmpswname=$tmpsw.name echo-inprogress "Switch $tmpswnam...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/SSH-demo-show-vlan-demoN5k01.ps1
SSH-demo-show-vlan-demoN5k01.ps1
Import-Module .\demoVars.psm1 $devName="demoN5K01.flashstack.local" $ssh1=New-SshSession -ComputerName $devName -Username $devUsr -Password $devPwd $cmd_output=Invoke-SshCommand -ComputerName $devName -Command "show vlan" -Quiet $dtstr=get-dtstr $outfile="demoN5K01-show-vlan"+$dtstr+".txt" $cmd_output | O...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/demoConnect.ps1
demoConnect.ps1
<#### # Set working directory #####> cd $workDir <##### # Connect to vCenter #####> echo-inprogress "Connecting to $vcInfra_name" $global:vcInfra=Connect-VIServer -Server $vcInfra_name -User $vcUsr -Password $vcPwd -WarningAction SilentlyContinue <##### # Connect to UCS1 and UCS2 #####> echo-inprogre...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/PING-test-single.ps1
PING-test-single.ps1
##### # # Test PING # Output - save result to file # ##### $captureDir = $workDir+"ping\" $dtstr=get-dtstr $dstIP = "www.cisco.com" $outFile = $captureDir+"PING-TEST-"+$dtstr.ToString()+".csv" out-file $outFile -encoding ascii "Year;Month;Day;Hour;Minute;Second;Msec;RTT" | out-file $outFile -encodin...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/CFG-delete-vlans.ps1
CFG-delete-vlans.ps1
##### # Load input files # CSV-VLANlist ##### Import-module .\demoVars.psm1 $listVLAN=Import-CSV $workDir"CSV-VLAN-list.csv" $listSW=Import-CSV $workDir"CSV-LANSW-list.csv" echo-inprogress "Deleting VLANs from switches" foreach($tmpsw in $listSW) { $tmpswname=$tmpsw.name echo-inprogress "Switch $tmps...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/SSH-demo-run-cfg-demoN5k01.ps1
SSH-demo-run-cfg-demoN5k01.ps1
Import-Module .\demoVars.psm1 $devName="demoN5K01.flashstack.local" $ssh1=New-SshSession -ComputerName $devName -Username $devUsr -Password $devPwd $cmd_output=Invoke-SshCommand -ComputerName $devName -Command "show run" -Quiet $dtstr=get-dtstr $outfile="demoN5K01-run-cfg"+$dtstr+".txt" $cmd_output | Out-...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/02-demo5.ps1
02-demo5.ps1
$dlgTitle = "Select CSV file" $dlgDir = "c:\Users\mrobas\Dropbox\Blogs, Presentations, Social, Marketing\2017\PowerShell for Network Engineers\Demos\" $dlgFilter = "CSV files (*.csv)|*.csv" $csvtmp = Read-OpenFileDialog -WindowTitle $dlgTitle -InitialDirectory $dlgDir -Filter $dlgFilter $global:csv25=Import-Csv $...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/02-demo1.ps1
02-demo1.ps1
$var1 = "Hello World!" $var2 = 100 $csvFile1 = read-Host -Prompt "Input CSV file: " $dlgTitle = "Select CSV file" $dlgDir = "c:\Users\mrobas\Dropbox\Blogs, Presentations, Social, Marketing\2017\PowerShell for Network Engineers\Demos\" $dlgFilter = "CSV files (*.csv)|*.csv" $csvFile2 = Read-OpenFileDialog ...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/02-demo3.ps1
02-demo3.ps1
$global:csv1="02-1-wrong delimiter.csv" $global:csvList1=Import-Csv $csv1
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/02-demo6.ps1
02-demo6.ps1
$dtstr=get-dtstr $outfile="hcInfra_ESXi-"+$dtstr+".csv" Get-VMHost -Server $vcInfra | Select @{N="ESXi";E={$_.Name}}, @{N="Connection State";E={$_.ConnectionState}} , @{N="CPU";E={$_.NumCpu}} , @{N="Memory";E={$_.MemoryTotalGB}} , @{N="Version";E={$_.Version}} | Export-Csv $outfile -Delimiter ";" -NoTypeInfor...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/02-demo4.ps1
02-demo4.ps1
$global:csv1="02-2-proper delimiter.csv" $global:csvList1=Import-Csv $csv1
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/02-demo2.ps1
02-demo2.ps1
$global:var1 = "Hello World!" $global:var2 = 100 $global:csvFile1 = read-Host -Prompt "Input CSV file: " $dlgTitle = "Select CSV file" $dlgDir = "c:\Users\mrobas\Dropbox\Blogs, Presentations, Social, Marketing\2017\PowerShell for Network Engineers\Demos\" $dlgFilter = "CSV files (*.csv)|*.csv" $global:csv...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/PING-test-list.ps1
PING-test-list.ps1
##### # # Test with ping # Input file with IP destinations # Output - save result to file # ##### $captureDir = $workDir+"ping\" $dtstr=get-dtstr $csvFile = "PING-test-list.csv" $csvList=Import-Csv $csvFile # Set output file $outFile = $captureDir+"CONN-VERIFY-"+$dtstr.ToString()+".csv" # Set buffer ...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/SSH-demo-run-cfg-ANY.ps1
SSH-demo-run-cfg-ANY.ps1
Import-Module .\demoVars.psm1 $devName=read-Host -Prompt "Hostname or IP: " $cmd1=read-Host -Prompt "Command: " $ssh1=New-SshSession -ComputerName $devName -Username $devUsr -Password $devPwd $cmd_output=Invoke-SshCommand -ComputerName $devName -Command $cmd1 -Quiet $dtstr=get-dtstr $outfile=$devName+"-"+...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/CAPTURE-switch.ps1
CAPTURE-switch.ps1
# switch list input file $csvListSw = "CAPTURE-switch-list.csv" # command list input file $csvListCmd = "CAPTURE-switch-cmd-list.csv" $captureDir = $workDir+"capture\" #Load Lists $csvSW=Import-Csv $csvListSw $csvCMD=Import-Csv $csvListCmd foreach($item in $csvSW) { $dtstr=get-dtstr New-SshSess...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/SAN/MDS-zoning-PURE-2FC-A.ps1
MDS-zoning-PURE-2FC-A.ps1
#### change to enter zoneset name !!!! <#### # Parameters # csvList - input CSV file with list of host alias names and WWPNs # # Output # DevAlias.txt file # #####> ###Get date & time $today = get-date $day = $today.Day $mth = $today.Month $year = $today.Year $hour = $today.Hour $min = $today.M...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/SAN/MDS-devalias-srv.ps1
MDS-devalias-srv.ps1
<##### # Parameters # csvList - input CSV file with list of host alias names and WWPNs # # Output # DevAlias.txt file # #####> #Get date & time $today = get-date $day = $today.Day $mth = $today.Month $year = $today.Year $hour = $today.Hour $min = $today.Minute $sec = $today.Second $date = "$year...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/SAN/MDS-zoning-VNX-4FC-B.ps1
MDS-zoning-VNX-4FC-B.ps1
#### change to enter zoneset name !!!! <#### # Parameters # csvList - input CSV file with list of host alias names and WWPNs # # Output # DevAlias.txt file # #####> ###Get date & time $today = get-date $day = $today.Day $mth = $today.Month $year = $today.Year $hour = $today.Hour $min = $today.M...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/SAN/MDS-zoning-VNX-4FC-A.ps1
MDS-zoning-VNX-4FC-A.ps1
#### change to enter zoneset name !!!! <#### # Parameters # csvList - input CSV file with list of host alias names and WWPNs # # Output # DevAlias.txt file # #####> ###Get date & time $today = get-date $day = $today.Day $mth = $today.Month $year = $today.Year $hour = $today.Hour $min = $today.M...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/SAN/MDS-zoning-PURE-2FC-B.ps1
MDS-zoning-PURE-2FC-B.ps1
#### change to enter zoneset name !!!! <#### # Parameters # csvList - input CSV file with list of host alias names and WWPNs # # Output # DevAlias.txt file # #####> ###Get date & time $today = get-date $day = $today.Day $mth = $today.Month $year = $today.Year $hour = $today.Hour $min = $today.M...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/HTTP server/HTTP-web-test.ps1
HTTP-web-test.ps1
##### # # Test HTTP # Output - save result to file # ##### #$captureDir = $workDir+"http\" $dtstr=Get-Date -format "yyyMMdd-HHmmss" $dstURI = "http://demomgmt1.flashstack.local:80/LOOPBACK" $outFile = $captureDir+"WEB-TEST-"+$dtstr.ToString()+".csv" out-file $outFile -encoding ascii out-file $outFil...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/HTTP server/HTTP-web-srv.ps1
HTTP-web-srv.ps1
function Load-Packages { param ([string] $directory = 'Packages') $assemblies = Get-ChildItem $directory -Recurse -Filter '*.dll' | Select -Expand FullName foreach ($assembly in $assemblies) { [System.Reflection.Assembly]::LoadFrom($assembly) } } Load-Packages $routes = @{ "/LOOPBACK" = { re...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/UCS/add-MACpool.ps1
add-MACpool.ps1
<# Parameters -Name -Descr -Org <OrgOrg> -AssignmentOrder = default, sequential Set individual values to non-default #> #Load list $List= Import-Csv “.\MACpool.csv“ #Add pools foreach($itemUCS in $ucsList) { $ucsRes="Adding MAC pool to UCS system - "+$itemUCS.ucs.name echo-infoYES $ucsRes ...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/UCS/add-VLAN.ps1
add-VLAN.ps1
#Load list $List= Import-Csv "VLAN.csv" foreach($itemUCS in $ucsList) { $ucsRes="Adding VLANs to UCS system - "+$itemUCS.ucs.name echo-infoYES $ucsRes foreach($item in $List) { $ucsLanCloud = Get-UcsLanCloud -Ucs $itemUCS.ucs $vlanRes = Add-UcsVlan -Id $item.vlan -Name $item.vlanname -L...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/UCS/add-ORG.ps1
add-ORG.ps1
<# Create ORGs #> $ORGTest = [regex]"^[A-Za-z0-9:.-_]*$" #Load list $List= Import-Csv “.\ORG.csv“ #Add ORGs foreach($itemUCS in $ucsList) { $ucsRes="Adding ORG to UCS system - "+$itemUCS.ucs.name echo-infoYES $ucsRes foreach($item in $List) { #Get parent ORG to configure ORG at ...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/UCS/demoConnect.ps1
demoConnect.ps1
<##### # Connect to UCS1 and UCS2 #####> echo-inprogress "Connecting to $ucs_sddcUCS1vip" $global:ucsUCS1= Connect-Ucs -Name $ucs_sddcUCS1vip -Credential $ucsCredentials -NotDefault echo-inprogress "Connecting to $ucs_sddcUCS2vip" $global:ucsUCS2= Connect-Ucs -Name $ucs_sddcUCS2vip -Credential $ucsCredentials -...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/UCS/add-additional-VLANs.ps1
add-additional-VLANs.ps1
#Load list $listVLAN= Import-Csv "VLAN-add.csv" $listNICtmpl=Import-Csv "VLAN-add2nictmpl.csv" foreach($itemUCS in $ucsList) { $ucsRes="Adding VLANs to UCS system - "+$itemUCS.ucs.name echo-task $ucsRes foreach($item in $listVLAN) { $ucsLanCloud = Get-UcsLanCloud -Ucs $itemUCS.ucs $v...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/UCS/delete-additional-VLANs.ps1
delete-additional-VLANs.ps1
#Load list $listVLAN= Import-Csv "VLAN-add.csv" $listNICtmpl=Import-Csv "VLAN-add2nictmpl.csv" foreach($itemUCS in $ucsList) { $ucsRes="Removing VLANs from NICs on "+$itemUCS.ucs.name echo-task $ucsRes foreach($itemNICtmpl in $listNICtmpl) { $CfgOrg = Get-UcsOrg -Name $itemNICtmpl.Org -Uc...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/UCS/add-UUIDpool.ps1
add-UUIDpool.ps1
<# Parameters -Name -Descr -Org <OrgOrg> -AssignmentOrder = default, sequential Set individual values to non-default #> $UUIDTest = [regex]"^[A-Fa-f0-9-]*$" #Load list $List= Import-Csv “.\UUIDPool.csv“ #Add pools foreach($itemUCS in $ucsList) { $ucsRes="Adding UUID pool to UCS system - "+$item...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/UCS/delete-ORG.ps1
delete-ORG.ps1
<# Create ORGs #> $ORGTest = [regex]"^[A-Za-z0-9:.-_]*$" #Load list $List= Import-Csv “.\ORG.csv“ foreach($itemUCS in $ucsList) { $ucsRes="Deleting ORG from UCS system - "+$itemUCS.ucs.name echo-infoYES $ucsRes foreach($item in $List) { #Remove ORG if (($item.Name.Length -le 16)...
PowerShellCorpus/Github/1mrobas_PowerShell-for-Networking-Engineers-20170213/Examples/UCS/delete-VLAN.ps1
delete-VLAN.ps1
#Load list $List= Import-Csv "VLAN.csv" foreach($itemUCS in $ucsList) { $ucsRes="Deleting VLAN from UCS system - "+$itemUCS.ucs.name echo-infoYES $ucsRes foreach($item in $List) { $ucsLanCloud = Get-UcsLanCloud -Ucs $itemUCS.ucs $vlanObj = Get-UcsVlan -Id $item.vlan -Ucs $itemUCS.ucs -Lan...
PowerShellCorpus/Github/jasonjas_powershell/CopyFilesSelection-Powershell.ps1
CopyFilesSelection-Powershell.ps1
#Created By Jason Svatos #Created 5-30-2015 #Added PS 1/2 Reflection.Assembly loadwithpartialname 6-4-2015 #Check version of Powershell if (($PSVersionTable.PSVersion).Major -lt "3") { # If powershell 1 / 2, use Reflection.Assembly to load System.Windows.Forms [System.Reflection.Assembly]::LoadWithPartialNa...
PowerShellCorpus/Github/jasonjas_powershell/Set-Permissions-ACL.ps1
Set-Permissions-ACL.ps1
function Set-Permission { <# .SYNOPSIS Add / Remove NTFS rights to files or folders .DESCRIPTION Modifies ACLs of folders and files using Get-Acl and Set-Acl. Created by Jason Svatos Created on 3/10/2016 Modified 3/12/2016 (Added ...
PowerShellCorpus/Github/jasonjas_powershell/ShortcutDriveChange.ps1
ShortcutDriveChange.ps1
<# .NOTES Jason Svatos Created 10/28/2015 Updated 11/30/2015 .SYNOPSIS Check for shared folders and mapped drives which have changed Change location of where they point to and save them Contains 3 functions - MappedDrivesIcons - Deskt...
PowerShellCorpus/Github/jasonjas_powershell/Out-HTML.ps1
Out-HTML.ps1
<# .SYNOPSIS Create a decent looking HTML report page from objects and strings Header and CSS from: http://myrandomthoughts.co.uk/2016/01/out-fancyhtml-function/ .DESCRIPTION Takes objects that are piped or declared and exports them to a HTML format where they can be viewed. ...
PowerShellCorpus/Github/jasonjas_powershell/CreateMenu.ps1
CreateMenu.ps1
<# .DESCRIPTION Useful functions which can be used in almost any fashion Powershell 2+ compatible Created 12/27/2015 by Jason Svatos jason@jasonsvatos.net .NOTES List of functions OutputError - Create error log and show on console Crea...
PowerShellCorpus/Github/jasonjas_powershell/DirectorySize.ps1
DirectorySize.ps1
<# .SYNOPSIS Get folder sizes or last write time Can also change a number to human readable byte size (KB, MB, GB, etc) See help for each function on how to use them Jason Svatos 2/2/2015 Functions in this script: - LastWriteShortDate (Get last write...
PowerShellCorpus/Github/jasonjas_powershell/StreamReader.ps1
StreamReader.ps1
function StreamReader { <# .SYNOPSIS Read text file(s) and parse them line-by-line using Stream Reader Much more memory-friendly and faster than Get-Content .NOTES Created By Jason Svatos Still working on this script - created 1/14/2016. ...
PowerShellCorpus/Github/simonhutson_Azure-ADFS/ADFS/Scripts/Deploy-AzureResourceGroup.ps1
Deploy-AzureResourceGroup.ps1
#Requires -Version 3.0 #Requires -Module AzureRM.Resources #Requires -Module Azure.Storage Param( [string] [Parameter(Mandatory=$true)] $ResourceGroupLocation, [string] $ResourceGroupName = 'ADFS', [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageContainerName = $R...
PowerShellCorpus/Github/rgl_windows-2016-vagrant/virtualbox-prevent-vboxsrv-resolution-delay.ps1
virtualbox-prevent-vboxsrv-resolution-delay.ps1
if ('VirtualBox' -ne (Get-WmiObject WIN32_BIOS -Property SMBIOSBIOSVersion).SMBIOSBIOSVersion) { Exit 0 } # to prevent long delays while resolving the vboxsrv (used by c:\vagrant) # NetBIOS name, hard-code its address in the lmhosts file. # see 12.3.9. Long delays when accessing shared folders # at http...
PowerShellCorpus/Github/rgl_windows-2016-vagrant/winrm.ps1
winrm.ps1
Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' trap { Write-Host Write-Output "ERROR: $_" Write-Output (($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1') Write-Host 'Sleeping for 60m to give you time to look around the virtual machine before self-destruction.....
PowerShellCorpus/Github/rgl_windows-2016-vagrant/provision.ps1
provision.ps1
Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' trap { #Write-Host #Write-Host 'whoami from autounattend:' #Get-Content C:\whoami-autounattend.txt | ForEach-Object { Write-Host "whoami from autounattend: $_" } #Write-Host 'whoami from current WinRM session:' #whoami /all >C...
PowerShellCorpus/Github/cjjnash_Glasswall/GlassWall/AzureResourceGroup2/Deploy-AzureResourceGroup.ps1
Deploy-AzureResourceGroup.ps1
#Requires -Version 3.0 #Requires -Module AzureRM.Resources #Requires -Module Azure.Storage Param( [string] [Parameter(Mandatory=$true)] $ResourceGroupLocation, [string] $ResourceGroupName = 'AzureResourceGroup2', [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageCon...
PowerShellCorpus/Github/cjjnash_Glasswall/GlassWall/AzureResourceGroup2/CustomScripts/HubInstall.ps1
HubInstall.ps1
$DBServer = $args[0] $dbAdminPassword = $args[1] $AdminEmail = $args[2] $SmtpRelay = $args[3] $SmtpPort = $args[4] $SmtpPassword = $args[6] $mgmtservhost = $args[7] Start-Transcript -Path "C:\temp\installlog.txt" -NoClobber ###Install Standard Features Install-WindowsFeature Web-Server Install-WindowsFeatur...
PowerShellCorpus/Github/cjjnash_Glasswall/GlassWall/AzureResourceGroup2/CustomScripts/AgentInstall.ps1
AgentInstall.ps1
$EventUploadIntervalMS = $args[0] $ScanningIntervalMS = $args[1] $SmtpRelay = $args[2] $ManagementServiceAddress = $args[3] $SmtpPort = $args[4] $MailRelayIntervalMS = $args[5] $AllowedDomains = $args[6] $AnalysisMode = $args[7] $MaximumSupportedMailSizeBytes = $args[8] $mgmtservhost = $args[9] $msi = "C:\t...
PowerShellCorpus/Github/cjjnash_Glasswall/GlassWall/AzureResourceGroup2/bin/Debug/staging/GlassWall/Deploy-AzureResourceGroup.ps1
Deploy-AzureResourceGroup.ps1
#Requires -Version 3.0 #Requires -Module AzureRM.Resources #Requires -Module Azure.Storage Param( [string] [Parameter(Mandatory=$true)] $ResourceGroupLocation, [string] $ResourceGroupName = 'AzureResourceGroup2', [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageCon...
PowerShellCorpus/Github/cjjnash_Glasswall/GlassWall/AzureResourceGroup2/bin/Debug/staging/GlassWall/CustomScripts/HubInstall.ps1
HubInstall.ps1
None
PowerShellCorpus/Github/cjjnash_Glasswall/GlassWall/AzureResourceGroup2/bin/Debug/staging/GlassWall/CustomScripts/AgentInstall.ps1
AgentInstall.ps1
None
PowerShellCorpus/Github/cjjnash_Glasswall/GlassWall/Materials/Powershell/AppSettingsUpdate.ps1
AppSettingsUpdate.ps1
## Sets config for the Inbound Agent $AppSettings = 'C:\Users\Chris Nash\Desktop\AppSettings.config' $doc = (Get-Content $AppSettings) | foreach { $_ -replace 'dev-gw-web.cloudapp.net', $ManagementServiceAddress -replace 'smtp-agent-1', $AgentUniqueName -replace '"ScanningIntervalMS" value="3000', $ScanningI...
PowerShellCorpus/Github/zulldesign_MyUmbraco/MyUmbraco/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/zulldesign_MyUmbraco/MyUmbraco/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/zulldesign_MyUmbraco/MyUmbraco/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/zulldesign_MyUmbraco/MyUmbraco/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/zulldesign_MyUmbraco/MyUmbraco/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/zulldesign_MyUmbraco/MyUmbraco/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/zulldesign_MyUmbraco/MyUmbraco/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/zulldesign_MyUmbraco/MyUmbraco/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/zulldesign_MyUmbraco/MyUmbraco/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/zulldesign_MyUmbraco/MyUmbraco/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/zulldesign_MyUmbraco/MyUmbraco/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/BenceMajor_SzArchHF/SpaceService/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/BenceMajor_SzArchHF/SpaceService/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/derari_fusion-choco/Kega Fusion/tools/chocolateyinstall.ps1
chocolateyinstall.ps1
# stop on all errors $ErrorActionPreference = 'Stop'; $packageName = 'Kega Fusion' $url = 'http://www.carpeludum.com/download/Fusion364.zip' $binRoot = Get-BinRoot $installDir = Join-Path $binRoot "$packageName" Install-ChocolateyZipPackage "$packageName" "$url" "$installDir" #Install-ChocolateyShortcut -s...
PowerShellCorpus/Github/Jan-Ka_coms/coms.ps1
coms.ps1
param([int]$port=8080, [string]$message="OK") $listener = New-Object System.Net.HttpListener $listener.Prefixes.Add("http://*:$port/") $listener.Start() while ($listener.IsListening) { $context = $listener.GetContext() #Blocks $buffer = [System.Text.Encoding]::UTF8.GetBytes($message ) $context.resp...
PowerShellCorpus/Github/AlvinHall_PSProfiles/WindowsPowerShell/profile.ps1
profile.ps1
#Set up Environment Variables $myDocs = [environment]::getfolderpath("mydocuments") $myScripts = $myDocs + "\Scripts" #Set up PSDrives New-PSDrive -Name Scripts -PSProvider FileSystem -Root $myScripts | Out-Null #region Load Profile Functions $functions = @( Get-ChildItem -Path $PSScriptRoot\Functions\*.ps1 -...
PowerShellCorpus/Github/AlvinHall_PSProfiles/WindowsPowerShell/Microsoft.PowerShell_profile.ps1
Microsoft.PowerShell_profile.ps1
# $profile.CurrentUserAllHosts loads first. # Common Functions are defined in $profile.CurrentUserAllHosts #Console pane options $console = $Host.UI.RawUI $console.ForegroundColor = $FGColor Write-host "`$FGColor: $fgcolor" $console.BackgroundColor = $BGColor #Prepare Environment Clear-Host Write-Host "We...
PowerShellCorpus/Github/AlvinHall_PSProfiles/WindowsPowerShell/Microsoft.PowerShellISE_profile.ps1
Microsoft.PowerShellISE_profile.ps1
# $profile.CurrentUserAllHosts loads first. # Common Functions are defined in $profile.CurrentUserAllHosts #Output Pane Options $psISE.Options.ConsolePaneBackgroundColor = $BGColor $psISE.Options.ConsolePaneTextBackgroundColor = $BGColor $psISE.Options.ConsolePaneForegroundColor = $FGColor $psISE.Options.FontName...
PowerShellCorpus/Github/AlvinHall_PSProfiles/WindowsPowerShell/Functions/Reload-Module.ps1
Reload-Module.ps1
Function Reload-Module { <# .SYNOPSIS Reloads a specified module or all modules .DESCRIPTION If a module has changed since it was originally loaded, you can use this function to reload that module If no module is specified, this will reload all Script Modules. .EXAMPLE ...
PowerShellCorpus/Github/AlvinHall_PSProfiles/WindowsPowerShell/Functions/Test-ConsoleHost.ps1
Test-ConsoleHost.ps1
Function Test-ConsoleHost { If ($host.Name -match 'consolehost') { $true } Else { $False } }
PowerShellCorpus/Github/shubhamkumarnayak_artifacts/vsartifact/startChocolatey.ps1
startChocolatey.ps1
<################################################################################################## Description =========== Bootstrap for ensuring pre-requisites are validated prior to installing chocolatey packages. Usage examples ============== PowerShell -ExecutionPolicy bypass...
PowerShellCorpus/Github/shubhamkumarnayak_artifacts/vsartifact/ChocolateyPackageInstaller.ps1
ChocolateyPackageInstaller.ps1
<################################################################################################## Description =========== - This script does the following - - installs chocolatey - installs specified chocolatey packages - This script generates logs in the following folder - - %ALLUSERSP...
PowerShellCorpus/Github/mattsalmon_jira-powershell/trigger-reindex.ps1
trigger-reindex.ps1
$ErrorActionPreference = "Stop" $jiraURL = "jira.yourdomain.com" $restapiuri = "https://$jiraURL/rest/api/2/reindex?type=BACKGROUND" $recipients = "jonh.smith@yourdomain.com>" $user = "username" $pass = "password" $pair = "$($user):$($pass)" $encodedCreds = [System.Convert]::ToBase64String([System.Text.Encodin...
PowerShellCorpus/Github/alainassaf_drain-xaserver/drain-xaserver.ps1
drain-xaserver.ps1
<# .SYNOPSIS This Script will drain users (disconnected sessions) from a XenApp Server that is set to prohibit new logons. .DESCRIPTION This Script will drain users (disconnected sessions) from a XenApp Server that is set to prohibit new logons. It is recommended that this script be run as a Citrix admin. In additi...
PowerShellCorpus/Github/ecampbellrc_Unlock-AD-account/unlockad.ps1
unlockad.ps1
Import-Module ActiveDirectory Function Unlock-me { Param( $username ) try { #Attempt to find the user in ActiveDirectory, Set the Password, and force user to change password at next logon $ADAccount = Get-ADUser -Identity $username unlock-adaccount -Identity...
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_NewRepo_2017_4_18_14_5_18/.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/pareta25_CEPM/Src/packages/Microsoft.AspNet.Providers.LocalDB.1.1/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) try { # Set up variables $timestamp = (Get-Date).ToString('yyyyMMddHHmmss') $projectName = [IO.Path]::GetFileName($project.ProjectName.Trim([IO.PATH]::DirectorySeparatorChar, [IO.PATH]::AltDirectorySeparatorChar)) $catalogName = "aspnet-$project...
PowerShellCorpus/Github/pareta25_CEPM/Src/packages/jQuery.2.1.1/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/pareta25_CEPM/Src/packages/jQuery.2.1.1/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/pareta25_CEPM/Src/packages/jQuery.2.1.1/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/pareta25_CEPM/Src/packages/Newtonsoft.Json.6.0.6/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...