full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/GithubGist/josheinstein_3145560_raw_5852528618a71e6c24856a4a609f9702b96cf68c_New-Password.ps1
josheinstein_3145560_raw_5852528618a71e6c24856a4a609f9702b96cf68c_New-Password.ps1
[CmdletBinding(DefaultParameterSetName='Normal')] param( [Parameter()] [Int32]$Length = 8, [Parameter(ParameterSetName="Complex")] [Switch]$Complex, [Parameter(ParameterSetName="Easy")] [Switch]$Easy ) begin { $Upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' $Lower = 'abc...
PowerShellCorpus/GithubGist/togakangaroo_3318552_raw_5d4d2965bf2203ad0f3e18e4c41f0a29e5728f4c_gistfile1.ps1
togakangaroo_3318552_raw_5d4d2965bf2203ad0f3e18e4c41f0a29e5728f4c_gistfile1.ps1
New-PSDrive HOST -PSProvider FileSystem -Root \\VBOXSVR\georgemauer $tempDir = ([system.io.path]::GetTempPath()) function edit { param( [Parameter(ValueFromPipeline=$true,Position=0)] $file ) begin { set-alias EDITOR 'W:\tools\sublime_text.bat' } process { EDITOR $file } } function Coalesce-Args {...
PowerShellCorpus/GithubGist/mikebuchanon_dc6a9a9ba39d5a9842da_raw_fbf162e8e0e7255fc49392360e23d80623d681ea_list-sessions.ps1
mikebuchanon_dc6a9a9ba39d5a9842da_raw_fbf162e8e0e7255fc49392360e23d80623d681ea_list-sessions.ps1
clear $regpath = "HKCU:\Software\SimonTatham\PuTTY\Sessions" $sessions = gci -path $regpath foreach($session in $sessions){ $fixedsession = $session -replace 'HKEY_CURRENT_USER','HKCU:' $sessionname = Split-Path $fixedsession -Leaf Write-Host $($sessionname -replace 'RS:|%20|.public.','') `t`t $(G...
PowerShellCorpus/GithubGist/glassdfir_24000caf48726ed84a5a_raw_6e65509695de933871309b6e5d9a59123273acad_livemap.ps1
glassdfir_24000caf48726ed84a5a_raw_6e65509695de933871309b6e5d9a59123273acad_livemap.ps1
[CmdletBinding(PositionalBinding=$false)] Param( [Parameter(Mandatory=$False)] [String] $Remote ="" ) $global:outputlines = @() $outfile = "liveprocessmap.html" $ComputerName="LocalHost" $Header = "<script src="https://www.google.com/jsapi" type="text/javascript"></script><script type="text/javascript...
PowerShellCorpus/GithubGist/rysstad_a24dc630df295dffd32a_raw_ec5569be390cbd2ec9466d74e6927c598c3b0733_Get-ProsentageThePowershellWay.ps1
rysstad_a24dc630df295dffd32a_raw_ec5569be390cbd2ec9466d74e6927c598c3b0733_Get-ProsentageThePowershellWay.ps1
# Use tostring("P"): $a = [math]::PI $b = [math]::E ($a/$a).tostring("P")
PowerShellCorpus/GithubGist/mattsalmon_5478540_raw_050fd627679e25e2df55272ff86f178570c7943e_install.ps1
mattsalmon_5478540_raw_050fd627679e25e2df55272ff86f178570c7943e_install.ps1
#Umbraco Power shell API #Default Nuget Params param($installPath, $toolsPath, $package, $project) if ($project) { #Connect to Umbraco Services API #Create Home DocumentType #Create Properties on Home DocumentType #Create TextPage DocumentType #Create Properties on TextPage #Set TextPage as child o...
PowerShellCorpus/GithubGist/nick-o_9219454_raw_fd929ab92b17b7afb97cc06117455a669f256faf_test_deploy.ps1
nick-o_9219454_raw_fd929ab92b17b7afb97cc06117455a669f256faf_test_deploy.ps1
Get-Process
PowerShellCorpus/GithubGist/trondhindenes_3fc8f394e426cefca702_raw_dae2217a218465c92de2e24475a07a57f31edcf0_PowerShell%20Workflow%20paralell%20with%20throttle%20limit.ps1
trondhindenes_3fc8f394e426cefca702_raw_dae2217a218465c92de2e24475a07a57f31edcf0_PowerShell%20Workflow%20paralell%20with%20throttle%20limit.ps1
workflow paralleltest { $a = 1..10 #Divide the 10 iterations into 3 (+1) blocks foreach -parallel -throttlelimit (($a.count)/3) ($b in $a) { Write-Output $b } } paralleltest
PowerShellCorpus/GithubGist/kujotx_5462869_raw_49b682b60b1579e3ecb00334a0f4c434c3606cd4_gistfile1.ps1
kujotx_5462869_raw_49b682b60b1579e3ecb00334a0f4c434c3606cd4_gistfile1.ps1
Write-Host "Create the fake file" $file = New-Item C:\temp\sillytest\new_file.txt -type file -force -value "__NAME__" Write-Host "Change to that directory" Set-Location "c:\temp\sillytest" Write-Host "Make it read only" sp $file IsReadOnly 1 Write-Host "Add the template folder" warmup addTemplateFolder sillytest...
PowerShellCorpus/GithubGist/mhinze_e65789ed26107038072c_raw_98cdfc915d98da6f93b24416ea3a4d748e7ea444_Disable-NServiceBusSetupCheck.ps1
mhinze_e65789ed26107038072c_raw_98cdfc915d98da6f93b24416ea3a4d748e7ea444_Disable-NServiceBusSetupCheck.ps1
function global:Disable-NServiceBusSetupCheck() { #default to current dir when debugging if(!$solutionScriptsContainer){ $solutionScriptsContainer = "./" } $packagesFolder = Join-Path $solutionScriptsContainer "..\packages" -Resolve Push-Location $packagesFolder # Load NSB po...
PowerShellCorpus/GithubGist/alanrenouf_be6342791941f9531cf5_raw_5e2b47d1b3a00e1cab36a83ab8ea08516ce65541_NatRules.ps1
alanrenouf_be6342791941f9531cf5_raw_5e2b47d1b3a00e1cab36a83ab8ea08516ce65541_NatRules.ps1
Function New-DNATRule ( $EdgeGateway, $ExternalNetwork, $OriginalIP, $OriginalPort, $TranslatedIP, $TranslatedPort, $Protocol) { $Edgeview = Search-Cloud -QueryType EdgeGateway -name $EdgeGateway | Get-CIView if (!$Edgeview) { Write-Warning "Edge Gateway with name $Edgeview not found" Exit } $URI ...
PowerShellCorpus/GithubGist/SimonWahlin_3c69d10a1c13aa439063_raw_9aa5754a4589660c7192f8272c8be75d0f6cdd62_gistfile1.ps1
SimonWahlin_3c69d10a1c13aa439063_raw_9aa5754a4589660c7192f8272c8be75d0f6cdd62_gistfile1.ps1
Function Init { $File = "$env:tmp\testfile.tmp" if(-Not (Test-Path -Path $File)){[Void](New-Item -Path $File -Type File)} Start-Service -Name Spooler } Function Validate { $File = "$env:tmp\testfile.tmp" $FileStatus = if(Test-Path -Path $File){'Exists'}else{'Removed'} $SrvStatus = (Get...
PowerShellCorpus/GithubGist/GraemeF_1116727_raw_00be82e1b9c4828bae24869d6e883d00793a9980_RestorePackages.ps1
GraemeF_1116727_raw_00be82e1b9c4828bae24869d6e883d00793a9980_RestorePackages.ps1
# Tools .\NuGet.exe i DotCover -s \\myserver\Dev\NuGetPackages -o Tools .\NuGet.exe i StyleCopCmd -s \\myserver\Dev\NuGetPackages -o Tools # Dependecies $packageConfigs = Get-ChildItem . -Recurse | where{$_.Name -eq "packages.config"} foreach($packageConfig in $packageConfigs){ Write-Host "Restoring" $packageC...
PowerShellCorpus/GithubGist/sunnyc7_4478200_raw_3b898e1be617ee56f52aabbd166bd5122de80ada_get-2010sg.ps1
sunnyc7_4478200_raw_3b898e1be617ee56f52aabbd166bd5122de80ada_get-2010sg.ps1
#Original Doug Finke's gist - https://gist.github.com/4467657 #download all scripting games code by Rohn Edwards $url="http://2012sg.poshcode.org/Scripts/By/862" (Invoke-WebRequest $url).links | where{$_.innerHTML -eq "Download"} | ForEach { $outFile = "c:\temp\$($_.outerText)" #"Downloading $($_.InnerHt...
PowerShellCorpus/GithubGist/tckz_135053_raw_5bbdc8883de262930e9e6663742cccabf37a64d7_report_wsus.ps1
tckz_135053_raw_5bbdc8883de262930e9e6663742cccabf37a64d7_report_wsus.ps1
param([switch]$nomail) trap [Exception] { $t = $error[0].ToString().Trim() + "`n" + $error[0].InvocationInfo.PositionMessage.Trim() [Diagnostics.EventLog]::WriteEntry("report_wsus", $t, "Error", 1) } [reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null $update_ser...
PowerShellCorpus/GithubGist/n-fukuju_8499843_raw_9acd8d87cb0be6258c7ff1ff857dc17f7964399a_form.ps1
n-fukuju_8499843_raw_9acd8d87cb0be6258c7ff1ff857dc17f7964399a_form.ps1
[void][Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") $form = New-Object System.Windows.Forms.Form $form.StartPosition = [Windows.Forms.FormStartPosition]::CenterScreen $button = New-Object System.Windows.Forms.Button $button.Text = "Exit" $button.Add_Click({ $form.Close() }) # <= これ ...
PowerShellCorpus/GithubGist/bohrshaw_8252232_raw_e9bdc42752102a8f471be399565063a7498a225a_python-virtualenv-install.ps1
bohrshaw_8252232_raw_e9bdc42752102a8f471be399565063a7498a225a_python-virtualenv-install.ps1
# http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows # Download files Invoke-WebRequest -OutFile ez_setup.py https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py Invoke-WebRequest -OutFile get_pip.py https://raw.github.com/pypa/pip/master/contrib/get-pip.py # Installing python ...
PowerShellCorpus/GithubGist/mwrock_5422718_raw_85a5f4e61328557b78bdb5ec9cd6e38ce0add6a6_gistfile1.ps1
mwrock_5422718_raw_85a5f4e61328557b78bdb5ec9cd6e38ce0add6a6_gistfile1.ps1
Add-Type -AssemblyName System.IO.Compression.FileSystem,System.IO.Compression $here= (Get-Item .).FullName $archive = [System.IO.Compression.ZipFile]::Open( (Join-Path $here "archive.zip"), [System.IO.Compression.ZipArchiveMode]::Create ) get-tfsPendingChange | % { [System.IO.Compression.ZipFileExtensions]::...
PowerShellCorpus/GithubGist/seankearney_4019944_raw_791096a32da5c4eae0991ec9271cc40332b25529_archiveLogs.ps1
seankearney_4019944_raw_791096a32da5c4eae0991ec9271cc40332b25529_archiveLogs.ps1
################################################################## # IIS Web Log Archive Script # Takes a path to a directory containing IIS Log files # Zips them up with 7-zip and stores the zip in a # directory multiple levels up. # Original log files are then deleted # # Expected folde...
PowerShellCorpus/GithubGist/Touichirou_67db5dfe42df11b0f514_raw_7a7c42be36f143da12a298ef289762fca344ce2a_auto-login-windows.ps1
Touichirou_67db5dfe42df11b0f514_raw_7a7c42be36f143da12a298ef289762fca344ce2a_auto-login-windows.ps1
# Enable Auto login Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name "AutoAdminLogon" -Value 1 # Set Auto login user Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name "DefaultUsername" -Value "vagrant" # Set Auto login password ...
PowerShellCorpus/GithubGist/ujiro99_6258121_raw_f55a9da07946032adfb56accd3ce4d193c57e454_profile.ps1
ujiro99_6258121_raw_f55a9da07946032adfb56accd3ce4d193c57e454_profile.ps1
# 現在のユーザー名とホスト名をタイトルに $global:currentuser = [System.Security.Principal.WindowsIdentity]::GetCurrent() $user_and_host = ($currentuser.name -replace "(.*?)\\(.*?)$", "`$2@`$1") $Host.UI.RawUI.WindowTitle = $user_and_host + " - Windows PowerShell" # プロンプトのカスタマイズ function prompt { write-host "" # ディレクトリの表示 (...
PowerShellCorpus/GithubGist/janikvonrotz_8331053_raw_f4c8e58b088858dd0860e0d255c1d36e75a081bf_Replace-ADMemberGroupWithUsers.ps1
janikvonrotz_8331053_raw_f4c8e58b088858dd0860e0d255c1d36e75a081bf_Replace-ADMemberGroupWithUsers.ps1
Import-Module ActiveDirectory Get-ADGroup -Filter * -SearchBase "OU=Projekte,OU=SharePoint,OU=Services,OU=vblusers2,DC=vbl,DC=ch" | where{$_.Name -like "SP_Projekt *"} | sort Name | %{ $Group = $_ Write-Host "Update group: $($_.Name)" $Members = Get-ADGroupMember $_ -Recursive | select -Unique ...
PowerShellCorpus/GithubGist/miwaniza_c00ddaf1df1554bdf0cd_raw_ea0063df07d9c4c7bae5cca427b126268b40aee2_Add-VaultUser.ps1
miwaniza_c00ddaf1df1554bdf0cd_raw_ea0063df07d9c4c7bae5cca427b126268b40aee2_Add-VaultUser.ps1
# You are already logged in Vault from Vault2014powerConsole # So you can freely use # $vltActiveConn.WebServiceManager.FilestoreVaultService - FileStoreService # $vltAdminSvc - AdminService $userName = 'AD' $password = '12345' $atype = 'Vault' # or 'ActiveDir' $firstName = 'Albrecht' $lastName = 'Dürer' $em...
PowerShellCorpus/GithubGist/ciphertxt_5244814_raw_d96ec396d368f998dcc2d1666555b55caa20e140_GetSPFarmSolutions.ps1
ciphertxt_5244814_raw_d96ec396d368f998dcc2d1666555b55caa20e140_GetSPFarmSolutions.ps1
function Get-SPFarmSolutions {     param (         [string] $directory = $(Read-Host -prompt "Enter a directory (use ""."" for current dir)")     )       if ($directory.Length -lt 2) {         $directory = [string]$pwd + "\\";     }       $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local;     $solut...
PowerShellCorpus/GithubGist/sunnyc7_11219860_raw_7a7df7f1d3fd3663b47c6ec2bc1846771a2553f7_Send-EmailMessage.ps1
sunnyc7_11219860_raw_7a7df7f1d3fd3663b47c6ec2bc1846771a2553f7_Send-EmailMessage.ps1
Function Send-EMailMessage { [CmdletBinding()] param( [Parameter(Position=1, Mandatory=$true)] [String[]] $To, [Parameter(Position=2, Mandatory=$false)] [String[]] $CcRecipients, [Parameter(Position=3, Mandatory=$false)] [String[]] $BccRecipients, [Par...
PowerShellCorpus/GithubGist/objectx_4131424_raw_06d5a50164054dc70b0b7b9aba7a8c44439c69a2_gistfile1.ps1
objectx_4131424_raw_06d5a50164054dc70b0b7b9aba7a8c44439c69a2_gistfile1.ps1
$mydir = Split-Path -parent $MyInvocation.MyCommand.Path $work_dir = [Environment]::GetFolderPath("MyDocuments") function start_process () { $veracity = Join-Path $(Get-Item HKLM:\Software\Sourcegear\Veracity).GetValue("InstallPath") "vv.exe" $processStartInfo = New-Object System.Diagnostics.ProcessSt...
PowerShellCorpus/GithubGist/aetos382_2084bd09a926485eace6_raw_3ed3ddb5e2382e5a188437e874a55d24f884bf41_sample1.ps1
aetos382_2084bd09a926485eace6_raw_3ed3ddb5e2382e5a188437e874a55d24f884bf41_sample1.ps1
function Hoge { param( [string[]] $x = @()) @($x) | % { ... } }
PowerShellCorpus/GithubGist/janikvonrotz_5749524_raw_c427cb23627fc3b873eba31501a16b8908b13656_LoadModulesAndSnapins.ps1
janikvonrotz_5749524_raw_c427cb23627fc3b873eba31501a16b8908b13656_LoadModulesAndSnapins.ps1
# import all mdoules Get-Module -ListAvailable | Import-Module # show module commands Get-Command –Module grouppolicy #--------------------------------------------------# # SharePoint #--------------------------------------------------# if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction Sil...
PowerShellCorpus/GithubGist/pepoluan_397ba99abe82480b1083_raw_de3dc13de73113e2761bfa2f47fc16c6df585949_CSV-FilterCols.ps1
pepoluan_397ba99abe82480b1083_raw_de3dc13de73113e2761bfa2f47fc16c6df585949_CSV-FilterCols.ps1
Function CSV-FilterCols() { param ( [Parameter(Mandatory=$true)][String]$InCsv, [Parameter(Mandatory=$true)][String[]]$ColNameRegex, [Switch]$NoGlobal=$false, [String]$CsvDelimiter=";", [String]$OutCsv="" ) If (!(Test-Path $InCsv)) { Write-Error "Fi...
PowerShellCorpus/GithubGist/arjenvanderende_4496146_raw_456c9e1622356fd790f4ccc994479cbd2dfa441b_invert_mouse_wheel_direction.ps1
arjenvanderende_4496146_raw_456c9e1622356fd790f4ccc994479cbd2dfa441b_invert_mouse_wheel_direction.ps1
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }
PowerShellCorpus/GithubGist/chgeuer_3905353_raw_3bce6b025e3bfaf8e74d9bb811bda8cc1f0dd412_setupLinuxInVPN.ps1
chgeuer_3905353_raw_3bce6b025e3bfaf8e74d9bb811bda8cc1f0dd412_setupLinuxInVPN.ps1
$vmname = "ptvlinux1" $linuxUser = "ptvadmin" $adminPassword = "!!test123" $imagename = "ptv-itb-test1-linux-galleryimage" $subnet = "azure2b" $affinitygroup = "ptvtest" $vnetname = "azure253" $media = "https://portalvhdszxpyfbp32jw28.blob.core.windows.net/vhds/ptv-itb-1.vhd" $cloudSvcName = "ptvlinux1" ...
PowerShellCorpus/GithubGist/ianblenke_27f29e3a4a64f0296abe_raw_428e4a8f043d67a1ecce764c1173856f7b1002be_Update-OneGet.ps1
ianblenke_27f29e3a4a64f0296abe_raw_428e4a8f043d67a1ecce764c1173856f7b1002be_Update-OneGet.ps1
<# .NOTES =========================================================================== Created with: PowerShell Studio 2014, Version 4.1.74 Created on: 11/10/2014 4:06 PM Company: SAPIEN Technologies, Inc. Contact: June Blender, juneb@sapien.com, @juneb_...
PowerShellCorpus/GithubGist/wadtech_4078495_raw_b2af7061604bc8ae310a892a28cb1ed451ff0a0c_Get-DistributionGroups.ps1
wadtech_4078495_raw_b2af7061604bc8ae310a892a28cb1ed451ff0a0c_Get-DistributionGroups.ps1
# List-DistributionGroups.ps1 # Peter Mellett 2012 # # Find all distribution groups of a user and list them to the console # # Example: # .\List-DistributionGroups.ps1 aperson@company.com # # Name # ==== # Marketing # Managers # [CmdletBinding()] Param( [Parameter(Mandatory=$True,Position=1)] [...
PowerShellCorpus/GithubGist/jeffpatton1971_aeee67af3ed8a713101c_raw_fe86ebd4430bcc3f5901edc92e036b7dbec095d2_Reset-HealthState.ps1
jeffpatton1971_aeee67af3ed8a713101c_raw_fe86ebd4430bcc3f5901edc92e036b7dbec095d2_Reset-HealthState.ps1
Function Reset-HealthState { param ( $AlertName, $ResolutionState ) $Criteria = "Name like '$($AlertName)' and ResolutionState != $($ResolutionState)" $Alerts = Get-SCOMAlert -Criteria $Criteria ForEach($Alert in $Alerts) { $Monitor = Get-SCOMMonitor -Id $Alert.MonitoringRuleId ...
PowerShellCorpus/GithubGist/kondratyev-nv_1d2de9ec85a93572ebc7_raw_13ab41fa2c7265c78aa7a405bc05b982ddfce795_rename.ps1
kondratyev-nv_1d2de9ec85a93572ebc7_raw_13ab41fa2c7265c78aa7a405bc05b982ddfce795_rename.ps1
# Set new name of project $newname=$args[0] # Rename .sln and .vcxproj files Rename-Item .\project.vcxproj .\$newname.vcxproj Rename-Item .\solution.sln .\$newname.sln # Replace old project name to new in file .sln $sln = gc .\$newname.sln $sln | %{ $_ -creplace 'project', $newname }| Set-Content .\$newnam...
PowerShellCorpus/GithubGist/pkirch_6b7f0f5e979ac9e35b57_raw_5838fe2b8f9d674a745a0d1a3ce36ea9614bdd69_StartingVMStatusSample.ps1
pkirch_6b7f0f5e979ac9e35b57_raw_5838fe2b8f9d674a745a0d1a3ce36ea9614bdd69_StartingVMStatusSample.ps1
Get-AzureVM <# Output ServiceName Name Status ----------- ---- ------ ...
PowerShellCorpus/GithubGist/peaeater_9650778_raw_0f2297760ced499db4bb76a67a3c87fecaf2aba4_meta2manifest.ps1
peaeater_9650778_raw_0f2297760ced499db4bb76a67a3c87fecaf2aba4_meta2manifest.ps1
# convert IA metadata XML to Solr-ready manifest XML <# metadata.imagecount - 2 => pagecount metadata.identifier => WebSafe($1) => id metadata.title => title, freetext metadata.date => toDecade($1) => date, date_free, freetext metadata.creator => name, name_free, freetext metadata.pub...
PowerShellCorpus/GithubGist/aokomoriuta_4995706_raw_a8caf927876b2946f6cd5e3e46220473f274b4e3_ReplaceFile.ps1
aokomoriuta_4995706_raw_a8caf927876b2946f6cd5e3e46220473f274b4e3_ReplaceFile.ps1
# カレントディレクトリに移動 cd "対象ディレクトリ"; # 各ファイルに対して操作 Get-ChildItem | ForEach-Object { # ファイル名を'-'で区切ってみたり $data = $_.Name.Split('-'); # ファイル名が"H"で始まってたら除外したり if($data[0][0] -ne 'H') { # 新しいファイル名を並び替えで作ったり $newname = $data[1] + "-" + $data[0] + "-" + $data[2]; # pdfじゃなかったら末尾に"-abs....
PowerShellCorpus/GithubGist/valenz_3f11468da5f426342336_raw_11112fb6723473ffaa11085e4fea8a9614f8b1c7_install.ps1
valenz_3f11468da5f426342336_raw_11112fb6723473ffaa11085e4fea8a9614f8b1c7_install.ps1
# EXCEPTION: # Die Datei "I:\Downloads\install.ps1" kann nicht geladen werden, da die Ausführung von Skripts auf diesem System # deaktiviert ist. Weitere Informationen finden Sie unter "about_Execution_Policies" # (http://go.microsoft.com/fwlink/?LinkID=135170). # + CategoryInfo : Sicherheitsfehler: ...
PowerShellCorpus/GithubGist/russellds_9688526_raw_9a7cf684053a6f16c799fc7ed4d3ade3162985b1_ConvertFrom-Html.ps1
russellds_9688526_raw_9a7cf684053a6f16c799fc7ed4d3ade3162985b1_ConvertFrom-Html.ps1
function ConvertFrom-Html { #.Synopsis # Convert a table from an HTML document to a PSObject #.Example # Get-ChildItem | Where { !$_.PSIsContainer } | ConvertTo-Html | ConvertFrom-Html -TypeName Deserialized.System.IO.FileInfo # Demonstrates round-triping files through HTML param( #...
PowerShellCorpus/GithubGist/hsiboy_c09e8598000893dbdd96_raw_affce98486f02a3d17c844a3226707a4a7b34254_chocolateyNewRelicInstall.ps1
hsiboy_c09e8598000893dbdd96_raw_affce98486f02a3d17c844a3226707a4a7b34254_chocolateyNewRelicInstall.ps1
$packageName = 'NewRelic.NetAgent' $fileType = 'msi' $license = '0000000000'; $proxy = 'http://proxy.big-corp.com:8080'; $host = gc env:computername $silentArgs = "/norestart /q NR_LICENSE_KEY=" + $license + " NR_HOST=" + $host + " NR_PROXY_ADDRESS=" + $proxy + ' /l*v c:\log.log'; $url = 'https://download.newreli...
PowerShellCorpus/GithubGist/mkchandler_8864804_raw_e9806a99d0ea23470ce0ca59988b5a707cbefcd5_DisableNuGetPackageRestore.ps1
mkchandler_8864804_raw_e9806a99d0ea23470ce0ca59988b5a707cbefcd5_DisableNuGetPackageRestore.ps1
# Usage: .\DisableNuGetPackageRestore.ps1 C:\Path\To\Solution.sln # Get the path that the user specified when calling the script $solution = $args[0] $solutionPath = Split-Path $solution -Parent $solutionName = Split-Path $solution -Leaf # Delete the .nuget directory and all contents Remove-Item (Join-Path $s...
PowerShellCorpus/GithubGist/xpando_8a896d903ceb7cc31192_raw_34d99877fbbde7c36bd6b7d27caad3ce607e2928_unzip.ps1
xpando_8a896d903ceb7cc31192_raw_34d99877fbbde7c36bd6b7d27caad3ce607e2928_unzip.ps1
function unzip($path,$to) { $7z = "$env:TEMP\7z" if (!(test-path $7z) -or !(test-path "$7z\7za.exe")) { if (!(test-path $7z)) { md $7z | out-null } push-location $7z try { write-host "Downloading 7zip" -foregroundcolor cyan $wc = new-object system.net.webC...
PowerShellCorpus/GithubGist/ebouwsema_e090c38534fa5515c3e9_raw_b5b42324547d09f3a9622114d8712f291319723a_CopyRemoteDatabase.ps1
ebouwsema_e090c38534fa5515c3e9_raw_b5b42324547d09f3a9622114d8712f291319723a_CopyRemoteDatabase.ps1
## Based on code by: Gianluca Sartori - @spaghettidba # # Loads the SQL Server Management Objects (SMO) # #Add-PSSnapin SqlServerCmdletSnapin100 #Add-PSSnapin SqlServerProviderSnapin100 Import-Module sqlps -DisableNameChecking function Get-DefaultFileDirectories ( [string]$server=$(throw "Server inst...
PowerShellCorpus/GithubGist/ianblenke_88a44731e83fa57abe3c_raw_dcec6de76ee447d2d58b59adc0477394ac55d71a_InstallUse_OneGet.ps1
ianblenke_88a44731e83fa57abe3c_raw_dcec6de76ee447d2d58b59adc0477394ac55d71a_InstallUse_OneGet.ps1
# Install Microsoft's OneGet and start using it icm $executioncontext.InvokeCommand.NewScriptBlock((New-Object Net.WebClient).DownloadString('https://gist.githubusercontent.com/ianblenke/27f29e3a4a64f0296abe/raw/428e4a8f043d67a1ecce764c1173856f7b1002be/Update-OneGet.ps1')) -ArgumentList $home\Documents\WindowsPowerShe...
PowerShellCorpus/GithubGist/VertigoRay_6524236_raw_9d570bf2ac4e2b5dfbd77ecea44b34f455c94f2e_sig.ps1
VertigoRay_6524236_raw_9d570bf2ac4e2b5dfbd77ecea44b34f455c94f2e_sig.ps1
[string](0..9|%{[char][int](32+("54698284737179506589").substring(($_*2),2))})-replace "\s{1}\b"
PowerShellCorpus/GithubGist/yuuichirou_8227275_raw_54ca7eeb54970c4dcf06a0dddccc567942343697_start_on_remote.ps1
yuuichirou_8227275_raw_54ca7eeb54970c4dcf06a0dddccc567942343697_start_on_remote.ps1
Clear-Host $proc = Get-WmiObject Win32_Process -Filter "name='javaw.exe'" | select-Object CommandLine,Name,ProcessId,Status,ThreadCount Write-Host $proc #Stop-Process $proc.ProcessId
PowerShellCorpus/GithubGist/RitchieFlick_9621461_raw_9606b64559a32c5262c50914a29b83970f8a6a50_Powershell_Prompt.ps1
RitchieFlick_9621461_raw_9606b64559a32c5262c50914a29b83970f8a6a50_Powershell_Prompt.ps1
<# .SYNOPSIS Personal Powershell profile of ritchief .DESCRIPTION This is the Powershell script for ritchief's personal Powershell Prompt. This includes many ideas, tips and tricks from different places and blogs. Links are added in the .LINK section. .LINK ht...
PowerShellCorpus/GithubGist/mwinkle_5530485_raw_23101d6f6e1f1f1c8da570e4aac0bfb3602b2d84_get-gitrepos.ps1
mwinkle_5530485_raw_23101d6f6e1f1f1c8da570e4aac0bfb3602b2d84_get-gitrepos.ps1
# start of something to help me manage git repos... # starting with a very basic list of them. gci -recurse -force -include .git | select -Property Parent, {$_.Parent.FullName} # ideal next step would potentially parse & return a list of remotes... # once I get remotes, I should also output current b...
PowerShellCorpus/GithubGist/hotpicklesoup_b922fe6efb5cab08f66f_raw_6a56a1c41fe42a15b5f26003e5c0dd299a49d7dd_UpdateDestination.ps1
hotpicklesoup_b922fe6efb5cab08f66f_raw_6a56a1c41fe42a15b5f26003e5c0dd299a49d7dd_UpdateDestination.ps1
function UpdateDestination { Param( $PUT_uri, $Update_objs ) $i = 0 ForEach ($obj in $Update_objs){ $i++ Write-Progress -id 0 -Activity "Updating $([string]$Obj.ObjectTypeName)" -Status $obj.name -PercentComplete (($i / $Update_objs.count) * 100) Try { $response = Invoke-WebRequest -Uri $PUT_...
PowerShellCorpus/GithubGist/jasonsedwards_1876643_raw_fc8d514c90ff5d97bb2ce7ca8af383b6525cefb1_getouad.ps1
jasonsedwards_1876643_raw_fc8d514c90ff5d97bb2ce7ca8af383b6525cefb1_getouad.ps1
# Function Find users OU function getADGroup { param([string]$adfindtype, [string]$cName) # Create A New ADSI Call $root = [ADSI]'' # Create a New DirectorySearcher Object $searcher = new-object System.DirectoryServices.DirectorySearcher($root) # Set the filter to search for a specific CNAME $searcher.filter = "...
PowerShellCorpus/GithubGist/underwhelmed_389767_raw_b91ba07bf796aa3034af0f5e3d2eefa61ac83578_sp_compilation_validation.ps1
underwhelmed_389767_raw_b91ba07bf796aa3034af0f5e3d2eefa61ac83578_sp_compilation_validation.ps1
$server = "localhost"; # The SQL Server instance name $database = "MyDB"; # The database name # Load the SMO assembly [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | out-null # Create the SMO objects $srv = New-Object "Microsoft.SqlServer.Management.SMO.Server" $server;...
PowerShellCorpus/GithubGist/codingoutloud_6782961_raw_2aee061f8ca07e78ca795092cad2ebff8e157223_which.ps1
codingoutloud_6782961_raw_2aee061f8ca07e78ca795092cad2ebff8e157223_which.ps1
<# Implements the Unix shell 'which' command using PowerShell. original: https://gist.github.com/codingoutloud/6782961 #> function WhichOnes { if ($args.Count -eq 0) { # obviously use of 'which' in usage text is a hack (since it is chosen to match the alias) Write-Host "usage: which [cmd1]...
PowerShellCorpus/GithubGist/pohatu_10627192_raw_5df6e680589c5a53005d14969dee940ef00008da_fizzbuzz.ps1
pohatu_10627192_raw_5df6e680589c5a53005d14969dee940ef00008da_fizzbuzz.ps1
1..100|%{"fizz"*!($_%3)+"buzz"*!($_%5)+"$_"*!(!($_%3)-or!($_%5));}
PowerShellCorpus/GithubGist/morgansimonsen_8529297_raw_79582104508e42ef91b7cf3471804d05ed579626_Control-AzureVMs.ps1
morgansimonsen_8529297_raw_79582104508e42ef91b7cf3471804d05ed579626_Control-AzureVMs.ps1
# Control-AzureVMs.ps1 # Shut down or start a set of Windows Azure VMs in sequence # v0.1 2014-01-20 # # Morgan Simonsen # www.cloudpower.no # morgansimonsen.wordpress.com Select-AzureSubscription "<subscription name>" If ($args[1] -eq $null) { $VMs = Get-Content (Join-Path $PSScriptRoot "Control-Azure...
PowerShellCorpus/GithubGist/JeremySkinner_383624_raw_fdb3357512cb9d13570a7de1c5d6474d48279d87_SwitchAutoCrlfSettingsToFalse.ps1
JeremySkinner_383624_raw_fdb3357512cb9d13570a7de1c5d6474d48279d87_SwitchAutoCrlfSettingsToFalse.ps1
# Takes a repository which has autocrlf set to true and changes it to false using powershell # Turn autocrlf off git config core.autocrlf false # Remove all files git rm --cached -r . # Re-add all files git diff --cached --name-only | foreach { git add $_ }
PowerShellCorpus/GithubGist/sunnyc7_04a285bafd56d89d4bac_raw_1ea38f5e5e711bff1d16cc202abd6b0bdf80c4de_Sharestate.ps1
sunnyc7_04a285bafd56d89d4bac_raw_1ea38f5e5e711bff1d16cc202abd6b0bdf80c4de_Sharestate.ps1
# Sharing state across different runspaces using a shared variable # Expirmenting with Boe's stuff # http://learn-powershell.net/2013/04/19/sharing-variables-and-live-objects-between-powershell-runspaces/ # Create a synhronized HashTable which will be shared across different runspaces $hash = [hashtable]::...
PowerShellCorpus/GithubGist/zhujo01_fef2a32a5a031ab7505f_raw_7cddae3ec81461ba92c45058abb41f6fef7d5470_openstack-vmware.ps1
zhujo01_fef2a32a5a031ab7505f_raw_7cddae3ec81461ba92c45058abb41f6fef7d5470_openstack-vmware.ps1
######################################################################## # Openstack Windows Bootstrapping Script # Supported OS: # - Windows 2008 Server R2 SP1 (TESTED) # - Windows 2008 Server (TO BE TESTED) # - Windows 2012 Server (TO BE TESTED) # Image Transformation Target Cloud # - VMWare vS...
PowerShellCorpus/GithubGist/wormeyman_d4fff00ccf57713fabbc_raw_d75e139b3ebcabf7b15f9fe2c2427f5329a9af9e_enableAdmin.ps1
wormeyman_d4fff00ccf57713fabbc_raw_d75e139b3ebcabf7b15f9fe2c2427f5329a9af9e_enableAdmin.ps1
# Run this command in an elevated (PowerShell) prompt. # You may have to run the commands in reverse order. # The first command activates the admin account net user administrator /active:yes # The second command gives it the password of "pass" without the quotes net user administrator pass
PowerShellCorpus/GithubGist/nmische_4657161_raw_1bd5f51db70e1c78e787c749a1e5f816a678352b_SetACL.ps1
nmische_4657161_raw_1bd5f51db70e1c78e787c749a1e5f816a678352b_SetACL.ps1
# This script allows Powershell Session Users to access services remotely # Get Powershell Session Users SID $objUser = New-Object System.Security.Principal.NTAccount("Powershell Session Users") $strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier]) # Get Current ACL for scmanager $strOld...
PowerShellCorpus/GithubGist/bbenoist_ca65b602c41db5f2408d_raw_9817a5f741caa8dd617c7a1f1e591cbf8e6382d9_chocolateyInstall.ps1
bbenoist_ca65b602c41db5f2408d_raw_9817a5f741caa8dd617c7a1f1e591cbf8e6382d9_chocolateyInstall.ps1
try { $packageName = 'VisualStudio2012WDX' $setupFile="$env:temp\wdexpress_full.exe" Get-ChocolateyWebFile "$packageName" "$setupFile" 'http://go.microsoft.com/?linkid=9816758' -checksum '6EEDE869379658DCC025E0FCD17BC2F8' -checksumType 'md5' Install-ChocolateyInstallPackage "$packageName" 'exe' "/Passive /N...
PowerShellCorpus/GithubGist/danielmoore_837193_raw_dd94dbe2c701da011da3eee71e7ad9d47ab8390d_git_svn_ps_prompt.ps1
danielmoore_837193_raw_dd94dbe2c701da011da3eee71e7ad9d47ab8390d_git_svn_ps_prompt.ps1
Get-ChildItem $psScriptRoot -filter *.ps1 | foreach { . $_.FullName } if(Get-Module prompt) { Remove-Module prompt } $prompt_kind = if($args[0]) { $args[0] } else { "bash" } if($prompt_kind -eq "bash") { function prompt { writeUserLocation Write-Host("`n$") -nonewline -foreg...
PowerShellCorpus/GithubGist/jpoehls_1478380_raw_a124decc685dedd80e8f0ebbf548c7b65bd66c55_Elevate-Process.ps1
jpoehls_1478380_raw_a124decc685dedd80e8f0ebbf548c7b65bd66c55_Elevate-Process.ps1
# Put this in your PowerShell profile. function Elevate-Process { <# .SYNOPSIS Runs a process as administrator. Stolen from http://weestro.blogspot.com/2009/08/sudo-for-powershell.html. #> $file, [string]$arguments = $args $psi = New-Object System.Diagnostics.ProcessStartInfo $file $psi.Argumen...
PowerShellCorpus/GithubGist/starkfell_4182813_raw_cfccbfb487a67e3fa50ba1be1423f1d9f23614e2_SCOM_Mon_Query.ps1
starkfell_4182813_raw_cfccbfb487a67e3fa50ba1be1423f1d9f23614e2_SCOM_Mon_Query.ps1
################################################################################# # # [SCOM_Mon_Query.ps1] - SCOM 2012 - Agent Monitoring Query Tool # # Author: Ryan Irujo # # Inception: 11.26.2012 # Last Modified: 11.30.2012 # # Syntax: ./SCOM_Mon_Query.ps1 <hostname> # # Script is HEAVILY in progress.....
PowerShellCorpus/GithubGist/jeffpatton1971_368fec5b8eff9e1f1891_raw_29abd7b2794c91acb1a2119d5c48b2b754ebc73d_Sample-NetActivity.ps1
jeffpatton1971_368fec5b8eff9e1f1891_raw_29abd7b2794c91acb1a2119d5c48b2b754ebc73d_Sample-NetActivity.ps1
# # Enable-WSManCredSSP -Role Client -DelegateComputer localhost # Enable-WSManCredSSP -Role Server # Try{ $ErrorActionPreference = "Stop"; $WinRMUser = "\`d.T.~Ed/{34846A7C-5BC4-4C23-A22A-D21C1DC99DF8}.{5408AD4E-3052-4F73-B45E-7DADBB999FE4}\`d.T.~Ed/"; $WinRMPass = ConvertTo-SecureString -String "\`...
PowerShellCorpus/GithubGist/virtualdreams_a25b9130f2fc2a846cd6_raw_787f0ced27b178b94faf6d8bf33806e88ac1ba73_build.ps1
virtualdreams_a25b9130f2fc2a846cd6_raw_787f0ced27b178b94faf6d8bf33806e88ac1ba73_build.ps1
param ( [string]$file ) if(!$file) { Write-Host "Path is not set." return } if(!(Test-Path $file)) { Write-Host "Path not found." return } ### pattern to search $pattern = "\[assembly: AssemblyFileVersion\(""(\d+)\.(\d+)\.(\d+)\.(\d+)\""\)\]" $update = $false $content = Get-Content $file -...
PowerShellCorpus/GithubGist/guitarrapc_945408f9bd94e7a8f108_raw_89863221c918032dcc5f1747d8962cc5c5399b21_Remove-Office365LisenceFromUser.ps1
guitarrapc_945408f9bd94e7a8f108_raw_89863221c918032dcc5f1747d8962cc5c5399b21_Remove-Office365LisenceFromUser.ps1
function Remove-Office365LicenseFromUser { [CmdletBinding()] param ( [Parameter(Position = 0, Mandatory = 1, HelpMessage = "Pass MsolUser Objects.")] [Microsoft.Online.Administration.User[]]$users ) begin { $ErrorActionPreference = "Stop" # get sku ...
PowerShellCorpus/GithubGist/mcollier_5749396_raw_14efdd0cedb80472789373dc9b01ab1526246a0c_teched_na_2013_downloads.ps1
mcollier_5749396_raw_14efdd0cedb80472789373dc9b01ab1526246a0c_teched_na_2013_downloads.ps1
cls [Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath $rss = (new-object net.webclient) #Set the username for windows auth proxy #$rss.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials # TechEd NA 2013 #$dataFeed = "http://channel9.msdn.com/Events...
PowerShellCorpus/GithubGist/andreaswasita_96290d29994d5e251b33_raw_4a5629103a3f5d6146b9e4fc97da3403be146bfc_TechEdILB%20Step%201.ps1
andreaswasita_96290d29994d5e251b33_raw_4a5629103a3f5d6146b9e4fc97da3403be146bfc_TechEdILB%20Step%201.ps1
$svc="techedadfs" $ilb="adfsilb" $subnet="App Subnet" $IP="10.0.1.55" Add-AzureInternalLoadBalancer -ServiceName $svc -InternalLoadBalancerName $ilb –SubnetName $subnet –StaticVNetIPAddress $IP
PowerShellCorpus/GithubGist/suzan2go_66289adf0bbf85f3529d_raw_2d671948341f24ab606597a2a3f698bbf8cfff92_get-failoverhost.ps1
suzan2go_66289adf0bbf85f3529d_raw_2d671948341f24ab606597a2a3f698bbf8cfff92_get-failoverhost.ps1
$Cl = Get-Cluster $array = New-Object 'System.Collections.Generic.List[System.String]' #fail over hostが持つIDを$arrrayに格納する。 foreach($a in $array) { foreach($fh in $a.ExtensionData.Configuration.DasConfig.AdmissionControlPolicy.Failoverhosts){ $array.add($fh) } } # ESXiホスト名 , HAホスト(tr...
PowerShellCorpus/GithubGist/wormeyman_443ce904bea86990471a_raw_3c844af67250606af8149efc66ae5da9641bae80_youTubeDLPrompt.ps1
wormeyman_443ce904bea86990471a_raw_3c844af67250606af8149efc66ae5da9641bae80_youTubeDLPrompt.ps1
# Download the Windows binary: http://rg3.github.io/youtube-dl/download.html # This script needs to be in the same folder as youtube-dl.exe # -- # Some websites require FFmpeg binaries to be in the same folder as well. # http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-latest-win32-static.7z # -- # Allow powe...
PowerShellCorpus/GithubGist/sandrinodimattia_4214953_raw_10075a61fb32d94137900457c6e38850063eba42_gistfile1.ps1
sandrinodimattia_4214953_raw_10075a61fb32d94137900457c6e38850063eba42_gistfile1.ps1
$user = Get-WMIObject Win32_UserAccount -Filter "Name='Administrator'" $username = -join ([Char[]]'abcdefghijklmnopqrstuvwxyz._-~´`àéèç' | Get-Random -count 15) $user.Rename($username)
PowerShellCorpus/GithubGist/wintlu_4cd53a0c15a0b9953b10_raw_a8c5d7682ecf721f94e08e6531d1851a2392ec44_FillBudgetHeadCountPayrollInput.ps1
wintlu_4cd53a0c15a0b9953b10_raw_a8c5d7682ecf721f94e08e6531d1851a2392ec44_FillBudgetHeadCountPayrollInput.ps1
#$web = Get-SPWeb "http://portal.delta-corp.com/sites/MyDelta/BPP" Function ReadBudgetHeadCount() { $bList = $web.Lists["Budget HeadCount"] $m = @{} foreach($i in $bList.Items){ $key = $i["Job Sub Function"] + "-" + $i["Job Grade"] if(!$m.ContainsKey($key)){ $initHeadCount = [...
PowerShellCorpus/GithubGist/bill-long_8810381_raw_de92cc9ac0178f998547c214734ad5daa3800f0f_Fix-DelegatedSetup.ps1
bill-long_8810381_raw_de92cc9ac0178f998547c214734ad5daa3800f0f_Fix-DelegatedSetup.ps1
# Fix-DelegatedSetup.ps1 # # In Exchange 2013, delegated setup fails if legacy admin groups still exist. However, # it's recommended that these admin groups not be deleted. To make delegated setup work, # you can temporarily place an explicit deny so that the Delegated Setup group # cannot see them. This script au...
PowerShellCorpus/GithubGist/mrlesmithjr_7954840_raw_97eec2a89db151329f3d8b0fbdbf4f1b86a16163_get_vmhost_net.ps1
mrlesmithjr_7954840_raw_97eec2a89db151329f3d8b0fbdbf4f1b86a16163_get_vmhost_net.ps1
#Provided by @mrlesmithjr #EveryThingShouldBeVirtual.com # # Set variable for all hosts in current vCenter $vmhosts = @(Get-VMHost) foreach ($vmhost in $vmhosts) { Get-NetworkAdapter $vmhost }
PowerShellCorpus/GithubGist/hobelinm_9456238_raw_fc22e1171c4cf4417787e3ebc180bb0d72f201af_DynamicLoadingTest.ps1
hobelinm_9456238_raw_fc22e1171c4cf4417787e3ebc180bb0d72f201af_DynamicLoadingTest.ps1
# Considering the test function in a given location # you can ignore the following line "function test{""Original Test""}" > test.ps1 # This is a sample of the stub that would peform the function of # finding and downloading the original function. For the sake of # the test we can consider that's already done i...
PowerShellCorpus/GithubGist/philipmat_9273405_raw_115dc9cf992324419ce33272fa786b5a07930f88_Microsoft.PowerShell_profile.ps1
philipmat_9273405_raw_115dc9cf992324419ce33272fa786b5a07930f88_Microsoft.PowerShell_profile.ps1
function Get-URL([string] $url) { (New-Object net.webclient).DownloadString($url) }
PowerShellCorpus/GithubGist/gshiva_c6048173763abbbef88a_raw_4e570ba3776c2cf9e0398c47e28b0b3270a63b55_testps.ps1
gshiva_c6048173763abbbef88a_raw_4e570ba3776c2cf9e0398c47e28b0b3270a63b55_testps.ps1
cinst git echo "Hello"
PowerShellCorpus/GithubGist/kyam_5575898_raw_8ef8db78d4b33558dd7dd3065a02263049b9bca0_Listed_InstalledApps.ps1
kyam_5575898_raw_8ef8db78d4b33558dd7dd3065a02263049b9bca0_Listed_InstalledApps.ps1
# Mapping Registry $InstalledApplicationRegistry = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall" New-PSDrive -Name Uninstall -PSProvider Registry -Root $InstalledApplicationRegistry ls Uninstall: Remove-PSDrive -Name Uninstall # remove Uninstall:
PowerShellCorpus/GithubGist/vScripter_10901166_raw_1dbf38c80799848e41f85bf953f22717a7de2dac_Get-ProcessorInventory.ps1
vScripter_10901166_raw_1dbf38c80799848e41f85bf953f22717a7de2dac_Get-ProcessorInventory.ps1
<# .SYNOPSIS Returns information about the Processor via WMI. .DESCRIPTION Information about the processor is returned using the Win32_Processor WMI class. You can provide a single computer/server name or supply an array/list. .PARAMETER Computers Single computer name, list of computers or .t...
PowerShellCorpus/GithubGist/astaykov_c68bc86f43ba28163312_raw_6d367f68e5cb005f3d7d5e2fb223b13ce75709f1_AzureCloudServiceAntiMalwareProtection.ps1
astaykov_c68bc86f43ba28163312_raw_6d367f68e5cb005f3d7d5e2fb223b13ce75709f1_AzureCloudServiceAntiMalwareProtection.ps1
Add-AzureAccount # use Select-AzureSubscription in case your account has more than one Select-AzureSubscription -SubscriptionName 'PUT HERE YOUR SUBSCRIPTION' [System.Xml.XmlDocument] $XmlConfig = New-Object System.Xml.XmlDocument # load the Antimalware extension configuration from external XML file # The content of ...
PowerShellCorpus/GithubGist/shiftkey_2916215_raw_fdc80f8556380902b6a5f313c1127a2ee962a215_Deployment.ps1
shiftkey_2916215_raw_fdc80f8556380902b6a5f313c1127a2ee962a215_Deployment.ps1
properties { $BaseDir = Resolve-Path "..\" $SolutionFile = "$BaseDir\Cocoon.sln" $OutputDir = "$BaseDir\Deploy\Package\" $ArtifactsDir = "$BaseDir\artifacts\" $NuGetPackDir = Join-Path "$OutputDir" "Pack\" $Version = "1.0.0." + (git rev-list --all | wc -l).trim() + "-rc" # TODO: better imp...
PowerShellCorpus/GithubGist/txchen_5287695_raw_4d3e8a1c617a86dbf33203e0b0ed8eaeef119005_parseini.ps1
txchen_5287695_raw_4d3e8a1c617a86dbf33203e0b0ed8eaeef119005_parseini.ps1
function ParseIni ($filePath) { $ini = @{} switch -regex -file $FilePath { "^\[(.+)\]$" # Section { $section = $matches[1] $ini[$section] = @{} } "^([^;].*[^\s])\s*=\s*([^\s].*[^\s])$" # Key { if (!($section)) ...
PowerShellCorpus/GithubGist/pkirch_058d757a799fa0087241_raw_3a5f97cb62e57537c1036434b6d3bf36045c129f_MVA03-Images.ps1
pkirch_058d757a799fa0087241_raw_3a5f97cb62e57537c1036434b6d3bf36045c129f_MVA03-Images.ps1
# sample 1 $images = Get-AzureVMImage $images.Count $images[0] # sample 2 $images | Group-Object -Property OS # sample 3 $images | Group-Object -Property PublisherName | Sort-Object -Property Name | Format-Table -Property Count, Name -AutoSize # sample 4 $images | Group-Object -Property ImageFamily | Sor...
PowerShellCorpus/GithubGist/tanaka-takayoshi_8066817_raw_3be89d9fb2c37178674c3a3af0a07195153455ec_Claudia.ps1
tanaka-takayoshi_8066817_raw_3be89d9fb2c37178674c3a3af0a07195153455ec_Claudia.ps1
$assemblies = ( "System", "PresentationCore", "PresentationFramework", "System.Windows.Presentation", "System.Xaml", "WindowsBase", "System.Xml" ) $source = @" using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; us...
PowerShellCorpus/GithubGist/goyuix_4199427_raw_26012028162d094b6e3da5e011163251aed42ec9_AddManagedMetadataMapping.ps1
goyuix_4199427_raw_26012028162d094b6e3da5e011163251aed42ec9_AddManagedMetadataMapping.ps1
# Description: script to create a managed property for search that maps to the Active (ows_RoutingEnabled) site column # Author: Greg McMurray # History: # 2012-12-3: Initial version # a few convenience variables $YesNo = [Microsoft.SharePoint.Search.Administration.ManagedDataType]::YesNo $searchApp = Get-SPEn...
PowerShellCorpus/GithubGist/miwaniza_9002529_raw_31455bbee72b750cc948d7db7959edfce044ab23_Login-VaultServer.ps1
miwaniza_9002529_raw_31455bbee72b750cc948d7db7959edfce044ab23_Login-VaultServer.ps1
#Connecting dll Add-Type -Path "C:\Program Files (x86)\Autodesk\Autodesk Vault 2014 SDK\bin\Autodesk.Connectivity.WebServices.dll" #Retreiving read-only credentials $cred = New-Object Autodesk.Connectivity.WebServicesTools.UserPasswordCredentials ("localhost", "Vault", "Administrator", "", $true) #Creating manager ...
PowerShellCorpus/GithubGist/Astn_9b07e331400a679afc9a_raw_ed51bcb0c57ed06fb441a9e55f5fb0f67a8e5129_all-render-nustache.ps1
Astn_9b07e331400a679afc9a_raw_ed51bcb0c57ed06fb441a9e55f5fb0f67a8e5129_all-render-nustache.ps1
# Get us out of a git directory if we are in one. #while (( ls -Directory -Hidden -Filter ".git" | measure).Count -gt 0 ) { # Write-Warning "Moving up a directory because a hidden .git folder was detected" # $loc = (Get-Location).Path # Write-Warning "Now at ${loc}" # cd .. # } ## pull...
PowerShellCorpus/GithubGist/peaeater_8be00dbcf2b0a4a0f28e_raw_33073af2ae8d824a93fca2af89dd378e36a65931_delete-eventlog-source.ps1
peaeater_8be00dbcf2b0a4a0f28e_raw_33073af2ae8d824a93fca2af89dd378e36a65931_delete-eventlog-source.ps1
<# Remove log source from Application Event Log - requires ADMIN PRIVILEGES Peter Tyrrell #> param( [Parameter(Mandatory=$true,ValueFromPipeline=$true,Position=0)] [string]$logsrc ) # check for admin if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::...
PowerShellCorpus/GithubGist/DavidWise_4438004_raw_a062b06634c8522ecb6536a91751b3e82f2a6ee6_Highlight-Syntax.ps1
DavidWise_4438004_raw_a062b06634c8522ecb6536a91751b3e82f2a6ee6_Highlight-Syntax.ps1
# Original Author: Lee Holmes, http://www.leeholmes.com/blog/MorePowerShellSyntaxHighlighting.aspx # Modified by: Helge Klein, http://blogs.sepago.de/helge/ # (http://blogs.sepago.de/e/helge/2010/01/18/syntax-highlighting-powershell-code-in-html-with-a-powershell-script) # Modified again by: David Wise, ht...
PowerShellCorpus/GithubGist/smasterson_9140810_raw_fd489f053ad97da11749a7f1e9da3fd82265d30a_Zip2Email.ps1
smasterson_9140810_raw_fd489f053ad97da11749a7f1e9da3fd82265d30a_Zip2Email.ps1
# Simple Backup to Email script # Requirements: 7-Zip to be installed # User Variables # Folder to zip and send $TheFolder = "E:\ZipMe" # (sub)Folder to exclude $fExclude = "SkipMe" # Path to zip file (output) $theDay = Get-Date -Format "MMddyyyy" $theTime = Get-Date -Format "HHmmss" $outfile = "E...
PowerShellCorpus/GithubGist/owenbyrne_6895094_raw_6b69fdfa16fe7b9f0655ffcb3d1c82a071546f0d_gistfile1.ps1
owenbyrne_6895094_raw_6b69fdfa16fe7b9f0655ffcb3d1c82a071546f0d_gistfile1.ps1
# variables $url = "http://packages.nuget.org/v1/Package/Download/Chocolatey/0.9.8.20" $chocTempDir = Join-Path $env:TEMP "chocolatey" $tempDir = Join-Path $chocTempDir "chocInstall" if (![System.IO.Directory]::Exists($tempDir)) {[System.IO.Directory]::CreateDirectory($tempDir)} $file = Join-Path $tempDir "chocola...
PowerShellCorpus/GithubGist/Nate630_4977282_raw_7393852585ea3cefecff772e91e1375414dc5458_gistfile1.ps1
Nate630_4977282_raw_7393852585ea3cefecff772e91e1375414dc5458_gistfile1.ps1
# # Puts everything in a specific SCOM GROUP in Maintenance Mode for x hours # # I'm not sure where I got this....script. Sorry. # # Uncomment the 'param' line below if you want to pass values by parameter to this script #param ($groupName, $MMDurationInHours, $rmsServerName) $MMDurationInHours = "3" $rm...
PowerShellCorpus/GithubGist/healeyio_6a4f2a8db12ba2a99666_raw_db56822affd1c7bddd964d8c7f62ae2d74eafc38_Update-LyncLocation.ps1
healeyio_6a4f2a8db12ba2a99666_raw_db56822affd1c7bddd964d8c7f62ae2d74eafc38_Update-LyncLocation.ps1
#requires –Version 3.0 <# .SYNOPSIS Updates Lync 2013 Client's location information with geolocation data based on internet ip address. .DESCRIPTION The Update-LyncLocation.ps1 script updates the Lync 2013 Client's location information. It uses the Telize web service to determine your external ip address and ...
PowerShellCorpus/GithubGist/atifaziz_7809279_raw_38f8c7032884f631f6341dba0a75210653c60776_Touch-Item.ps1
atifaziz_7809279_raw_38f8c7032884f631f6341dba0a75210653c60776_Touch-Item.ps1
# Copyright (c) 2013 Atif Aziz. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
PowerShellCorpus/GithubGist/gravejester_bf39cd17808ae89598d0_raw_17591be0dd06125c430024e71572b62f1b49e762_Invoke-SqlCommand.ps1
gravejester_bf39cd17808ae89598d0_raw_17591be0dd06125c430024e71572b62f1b49e762_Invoke-SqlCommand.ps1
function Invoke-SqlCommand{ <# .SYNOPSIS Invoke SQL command(s) to a database server. .DESCRIPTION This function will take a SQL query and a database connection and rund the SQL query/commands and optionally return data as a DataTable object. .EXAMPLES ...
PowerShellCorpus/GithubGist/djcsdy_874592_raw_c4d4616de1ef0075e3ba429383f468661622a8bb_svn-clean.ps1
djcsdy_874592_raw_c4d4616de1ef0075e3ba429383f468661622a8bb_svn-clean.ps1
svn status | Select-String '^\?' | ForEach-Object { [Regex]::Match($_.Line, '^[^\s]*\s+(.*)$').Groups[1].Value } | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
PowerShellCorpus/GithubGist/RunnerRick_ea1905d8c1e49be11559_raw_bc2f32293675cf96a3b04f0b2c6cbc4fe09dada0_Microsoft.PowerShell_profile.ps1
RunnerRick_ea1905d8c1e49be11559_raw_bc2f32293675cf96a3b04f0b2c6cbc4fe09dada0_Microsoft.PowerShell_profile.ps1
function prompt { # $user = (get-item env:USERNAME).Value # $host = (get-item env:COMPUTERNAME).Value $directoryName = (get-location).Path.Substring((get-location).Path.LastIndexOf("\") + 1) "$directoryName>" }
PowerShellCorpus/GithubGist/westurner_10950476_raw_fe316fd77d787bdf10c506580691075a2c96961c_cinst_workstation_minimal.ps1
westurner_10950476_raw_fe316fd77d787bdf10c506580691075a2c96961c_cinst_workstation_minimal.ps1
### PowerShell script to install a minimal Workstation with Chocolatey # https://chocolatey.org ## To Run This Script: # 1. Download this PowerShell script # * Right-click <> ("View Raw") and "Save As" to %USERPROFILE% (/Users/<username>) # * If Cocolatey is not already installed, see # "Uncomment to...
PowerShellCorpus/GithubGist/jiulongw_0bc4dfe787708dc12b12_raw_138251fa2afff938b56e4819e93942d50a7664e9_CreateRemoteShareFolders.ps1
jiulongw_0bc4dfe787708dc12b12_raw_138251fa2afff938b56e4819e93942d50a7664e9_CreateRemoteShareFolders.ps1
param ( [parameter(Mandatory = $true)] [string] $computerName, [parameter(Mandatory = $false)] [string] $logShareLocal = "D:\data\BTLUX_Shares\LuxLogShare", [parameter(Mandatory = $false)] [string] $logShareName = "LuxLogShare", [parameter(Mandatory = $false)] [string] $sanLocal = "D:\data\BTLUX_Shares\...