full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/GithubGist/yzorg_8215221_raw_6fee7d7a8df7cfd80fe64297c583f2d162ad840f_profile_basic.ps1
yzorg_8215221_raw_6fee7d7a8df7cfd80fe64297c583f2d162ad840f_profile_basic.ps1
Write-Host "START [$($MyInvocation.MyCommand.Name)] $(get-date -f yyyyMMdd.HHmmss.ff)" # cd to the first directory in the path that contains a program, script, or file filter gowhere { where.exe $args | select -first 1 | Split-Path -Parent | cd } sal w where.exe # powershell pre-defines where to be 'SQL-like' wh...
PowerShellCorpus/GithubGist/psudmant_7031044_raw_7be1c65d5bd664c082686411d423d61030c1d880_gistfile1.ps1
psudmant_7031044_raw_7be1c65d5bd664c082686411d423d61030c1d880_gistfile1.ps1
# set this to your head node hostname (run hostname) HEAD_NODE_NAME=master if [ `hostname` = $HEAD_NODE_NAME ]; then NODES=`qconf -sel | grep -v $HEAD_NODE_NAME` for NODE in $NODES; do SCRIPT_PATH=$(dirname `which $0`) qsub -l h=$NODE $SCRIPT_PATH done else # YOUR COMMANDS Y...
PowerShellCorpus/GithubGist/pkirch_507ae99421c3cf1eba94_raw_e1e63650250147ddf6ceb81148937c692a9f2fa0_SetAzureSubscriptionCert.ps1
pkirch_507ae99421c3cf1eba94_raw_e1e63650250147ddf6ceb81148937c692a9f2fa0_SetAzureSubscriptionCert.ps1
# Get certificate from personal certificate store. $cert = Get-Item Cert:\CurrentUser\My\096E6A67C50C4BCED9E27D51013CA92272F73FCD # Add Azure subscription parameter set including name, ID, and certificate. Set-AzureSubscription -SubscriptionName "Azure MSDN - pkirchner" -SubscriptionId c6244819-a8d6-4279-b492-4...
PowerShellCorpus/GithubGist/Scuzzbopper_7656383_raw_1c1e9d7a5440014e55e6c094670d39730f4bbe4b_gistfile1.ps1
Scuzzbopper_7656383_raw_1c1e9d7a5440014e55e6c094670d39730f4bbe4b_gistfile1.ps1
for /r %%i in (*.mov) do "C:\Program Files\Handbrake\HandBrakeCLI.exe" -i "%%i" -t 1 -o "D:\%%~ni.mp4" -f mp4 --strict-anamorphic -e x264 -b 3500 -2 -T --vfr -a 1 -E faac -B 128 -6 dpl2 -R 44.1 -D 0 --gain=0 --audio-copy-mask none --audio-fallback ffac3 -x ref=6:weightp=1:rc-lookahead=10:b-adapt=2:bframes=6:me=umh:...
PowerShellCorpus/GithubGist/ctrlbold_790abdc6fb4d010f8dda_raw_626bb3674a9c17981a0343e63bd6e5ac62f1dde4_Get-LocateCE.ps1
ctrlbold_790abdc6fb4d010f8dda_raw_626bb3674a9c17981a0343e63bd6e5ac62f1dde4_Get-LocateCE.ps1
if ($PSScriptRoot) { $location = $PSScriptRoot } else { $location = (Get-Location).Path } $dll = "$location\System.Data.SqlServerCe.dll" # look into SQLiteDataAdapter if ($GetDll) { $wc = New-Object System.Net.WebClient $url = "https://netnerds.net/System.Data.SqlServerCe.dll" $wc.DownloadFile($url,$dl...
PowerShellCorpus/GithubGist/michl86_6130656_raw_caf37a27fa91e6c1144e499aadfa58d1e17c216a_GetDiskDriveOfFolder.ps1
michl86_6130656_raw_caf37a27fa91e6c1144e499aadfa58d1e17c216a_GetDiskDriveOfFolder.ps1
function GetDiskDriveOfFolder { Param ( [string]$path=$(throw("You must specify a filename to get the diskdrive information of.")) ) $diskdrive = gwmi win32_diskdrive foreach($drive in $diskdrive){ $partitions = gwmi -Query "ASSOCIATORS OF {Win32_DiskDrive.DeviceID=`"$($drive....
PowerShellCorpus/GithubGist/mlinnell_8201937_raw_2f0a8c92ab6b3bfdd814c0962c6e355c43f36c35_Create-WebConfigTransform.ps1
mlinnell_8201937_raw_2f0a8c92ab6b3bfdd814c0962c6e355c43f36c35_Create-WebConfigTransform.ps1
<# .SYNOPSIS Create a configuration transformation .DESCRIPTION This script runs an ASP.NET configuration transformation, given a source configuration and transformation file. MSBuild.exe is assumed to be in the path, and Visual Studio 2012 should be installed. Modify the path to Microsoft.Web.Publishing.Tas...
PowerShellCorpus/GithubGist/mscharley_32c387264b5ae24a4522_raw_ce2c2c37c19d3991b616c7d983e9fd7c89bbac37_skype.ps1
mscharley_32c387264b5ae24a4522_raw_ce2c2c37c19d3991b616c7d983e9fd7c89bbac37_skype.ps1
$skypePath = (Get-ItemProperty -Path hkcu:\SOFTWARE\Skype\Phone).SkypePath if (!(Test-Path $skypePath -pathType leaf)) { Write-Host "Unable to find Skype for Desktop. Is it installed correctly?" pause exit 1 } $dataPath = "$($env:localappdata)\SkypePortable" $instanceCount = 2 for ($i = 1; $i -le $i...
PowerShellCorpus/GithubGist/jchadwick_1082558_raw_5ae7b268c2ccefdb45bdb3c0e7f2aeb46dfe3903_Upgrade-Package.ps1
jchadwick_1082558_raw_5ae7b268c2ccefdb45bdb3c0e7f2aeb46dfe3903_Upgrade-Package.ps1
########################################################### # # Script to upgrade all NuGet packages in solution to latest version # https://gist.github.com/1082558 # # USAGE # Place this file (Upgrade-Packages.ps1) to your solution folder. # From Package Manager Console execute # # .\Upgrade-Packages.ps1 -Pa...
PowerShellCorpus/GithubGist/taesiri_9648811_raw_2d437328f02d36c977f0ad02c94438e89099efd9_gistfile1.ps1
taesiri_9648811_raw_2d437328f02d36c977f0ad02c94438e89099efd9_gistfile1.ps1
write-host("Ad-Hoc Creator") write-host("Please enter an SSID") -foreground "green" $network_name = Read-Host write-host("Please enter a Password") -foreground "green" $network_pass = Read-Host write-host "Stopping current hosted network ..." -foreground "yellow" netsh wlan stop hostednetwork write-host "Creati...
PowerShellCorpus/GithubGist/thorade_e4dec248c95d49d40fcd_raw_b25d6ef4535b415ceb058ccf8d2b8f37dab5d92a_findFileExtensions.ps1
thorade_e4dec248c95d49d40fcd_raw_b25d6ef4535b415ceb058ccf8d2b8f37dab5d92a_findFileExtensions.ps1
# This PowerShell Script will recursively scan all files in the given $scanDir # and print a list of all file extensions it finds # # get current directory $curPath = Split-Path -Parent $MyInvocation.MyCommand.Path $curDir = Split-Path -Leaf -Path $curPath $scanDir = "BuildingSystems" $scanPath = $curPath + "\...
PowerShellCorpus/GithubGist/alexisnomine_9408777_raw_06f285aaaf0c9415203b27a97832e574c84b49fb_DocxToPdf.ps1
alexisnomine_9408777_raw_06f285aaaf0c9415203b27a97832e574c84b49fb_DocxToPdf.ps1
Param( [Parameter(Mandatory=$True)] [string]$FilePath ) $Files = Get-ChildItem "$FilePath\*.docx" $Word = New-Object -ComObject Word.Application Foreach ($File in $Files) { # open a Word document, filename from the directory $Doc = $Word.Documents.Open($File.FullName) # Swap out DOCX with PD...
PowerShellCorpus/GithubGist/pjmagee_11374776_raw_7502b7fb822a2d69082b508cb699df02ed0a060c_gistfile1.ps1
pjmagee_11374776_raw_7502b7fb822a2d69082b508cb699df02ed0a060c_gistfile1.ps1
# Restore a Database backup to the given database name # providing the SQL .bak file to use. # Author: Patrick Magee # TODO: Load password from external source. Import-Module sqlps -Verbose $databaseName = "SQL_DATABASE_NAME" # Local UAT Database Backup Name $backupFile = "SQL_BACKUP_FILE.bak" # The file ...
PowerShellCorpus/GithubGist/ao-zkn_67d0b6d831be22efc996_raw_c7d6a8d983929942456b00376ec4552eac96ef28_Write-Log.ps1
ao-zkn_67d0b6d831be22efc996_raw_c7d6a8d983929942456b00376ec4552eac96ef28_Write-Log.ps1
# ------------------------------------------------------------------ # デバッグログをファイルに出力する # 関数名:Write-DebugLog # 引数 :Value ログとして出力する文字列 # 戻り値:なし # ------------------------------------------------------------------ function Write-DebugLog([String]$VALUE){ if($LogLevel-le 0){ Out-LogFile -LogFilePath $LogFilePath -V...
PowerShellCorpus/GithubGist/edeustace_2700126_raw_b21cf0119424d44acfc0882c2562ec9ed552f440_download_zip.ps1
edeustace_2700126_raw_b21cf0119424d44acfc0882c2562ec9ed552f440_download_zip.ps1
# copy items # if you have a zip here: http://myserver.com/my.zip and it contains myFile.txt and myFolder/myOtherFile.txt # you can call this script like so: # .\download_zip.ps1 http://myserver.com/my.zip "myFile.txt|c:\myFileDestination\myFileHere.txt" "myFolder/myOtherFile.txt|c:\myOtherDestination\myOtherFile.tx...
PowerShellCorpus/GithubGist/astaykov_02540f3e0d9e19a016ee_raw_3d3e452edfa771f5ffc7d5f163a6fa62dc5b9f54_AzureResetVMAdminPassword.ps1
astaykov_02540f3e0d9e19a016ee_raw_3d3e452edfa771f5ffc7d5f163a6fa62dc5b9f54_AzureResetVMAdminPassword.ps1
$cred = Get-Credential -UserName "user@domain.com" -Message "Enter your OrgID to manage Azure" Add-AzureAccount -Credential $cred Select-AzureSubscription -SubscriptionName "<Put actual subscription name here>" $adminCredentials = Get-Credential -Message "Enter new Admin credentials" $VM = Get-AzureVM -Name "<put azu...
PowerShellCorpus/GithubGist/chrisobriensp_7796641_raw_8ad58d1e4762d2e3923b8f06f3d18f275d5b33da_PS_SPO_ListSiteCollections.ps1
chrisobriensp_7796641_raw_8ad58d1e4762d2e3923b8f06f3d18f275d5b33da_PS_SPO_ListSiteCollections.ps1
. .\PS_SPO_TopOfScript.ps1 Get-SPOSite -Limit All
PowerShellCorpus/GithubGist/inoues_9654742_raw_266daf47b9b6662f98cfb8b9c13d0fcf99605696_ping_chek.ps1
inoues_9654742_raw_266daf47b9b6662f98cfb8b9c13d0fcf99605696_ping_chek.ps1
# 対象機器のIPアドレスを格納した配列 # 名前とIPは同じ順番で入れてね [String[]]$addressAp = @('localhost') [String[]]$userName = @('OWN') #ファイル名の指定 [string]$HtmlFileName = [Environment]::GetFolderPath('Desktop') + '\pingResult.html' # HTMLファイルの上部 [string]$htmlhead = @" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <ht...
PowerShellCorpus/GithubGist/seperman_7924128_raw_e4567b3b3dc54352513334266f9f1edf395e85a2_New-CommandWrapper.ps1
seperman_7924128_raw_e4567b3b3dc54352513334266f9f1edf395e85a2_New-CommandWrapper.ps1
############################################################################## ## ## New-CommandWrapper ## ## From Windows PowerShell Cookbook (O'Reilly) ## by Lee Holmes (http://www.leeholmes.com/guide) ## ############################################################################## <# .SYNOPSIS Adds ...
PowerShellCorpus/GithubGist/ADABman_5178646_raw_9a9cb7ba7b4421478f9fa48e7463e1c0cd626ce5_gistfile1.ps1
ADABman_5178646_raw_9a9cb7ba7b4421478f9fa48e7463e1c0cd626ce5_gistfile1.ps1
exit # ------------------------------------------------------- # - 3 NODE HV Failover Cluster with Starwind Native SAN - # - QOS, BW Management, VLAN - # - By Brian Millar (adabman at gmail.com) - # ------------------------------------------------------- # !!! ...
PowerShellCorpus/GithubGist/sureshnath_90174d7506f4332ae4b6_raw_07bf9c46fa09240fd5ff96b6f816359f658b71bd_powershell.ps1
sureshnath_90174d7506f4332ae4b6_raw_07bf9c46fa09240fd5ff96b6f816359f658b71bd_powershell.ps1
#create directory if not exists $TARGETDIR = "c:\Temp\test\1\2" if(!(Test-Path -Path $TARGETDIR )){ New-Item -ItemType directory -Path $TARGETDIR } #get basename of url $URL = "http://stackoverflow.com/questions/4546567/get-last-element-of-pipeline-in-powershell" $NAME = $URL.Split('/') | Select-Object -La...
PowerShellCorpus/GithubGist/tsubik_34d2d80e90a924fc718c_raw_b6cc5100323823b82564decb6189b98e2bc2f48c_AddMigration.ps1
tsubik_34d2d80e90a924fc718c_raw_b6cc5100323823b82564decb6189b98e2bc2f48c_AddMigration.ps1
#Author: Tomasz Subik http://tsubik.com #Date: 2014-05-27 #License: MIT Param( [parameter(Mandatory=$false)] [alias("n")] $name = [System.Guid]::NewGuid().ToString(), [parameter(Mandatory=$false)] [alias("p")] $project = "DefaultProjectName", [parameter(Mandatory=$false)] [alia...
PowerShellCorpus/GithubGist/pavelbinar_6640084_raw_914649679a73d4ded888071a3374d45a02c703d3_gistfile1.ps1
pavelbinar_6640084_raw_914649679a73d4ded888071a3374d45a02c703d3_gistfile1.ps1
# run command and log out and log in sudo rm -ri ~/.Trash
PowerShellCorpus/GithubGist/mhinze_1885377_raw_ae09ab09f2eb01b90d7484d2b536b9909730dd5c_exposeiis.ps1
mhinze_1885377_raw_ae09ab09f2eb01b90d7484d2b536b9909730dd5c_exposeiis.ps1
function global:ExposeIIS() { $config = [xml] ( get-content $env:IIS_USER_HOME/config/applicationhost.config ) # Add in new bindings for computer name foreach($site in $config.configuration."system.applicationHost".sites.site) { foreach($bindings in $site.bindings) { # no need to add another bindin...
PowerShellCorpus/GithubGist/dfinke_6951741_raw_58043f68b93f510b353adee20e36113aeec9a554_ExtractSVN.ps1
dfinke_6951741_raw_58043f68b93f510b353adee20e36113aeec9a554_ExtractSVN.ps1
$svninfo = @{} svn help | ?{$_ -match "^ "} | %{($_.trim() -split " ")[0]} | %{ $command = $_ if(!$svninfo.ContainsKey($command)) { $svninfo.$command=@{SingleHyphen=@();DoubleHyphen=@()} } svn help $_ | ?{$_ -match "^\s+-"} | ...
PowerShellCorpus/GithubGist/oazabir_8e3187b5756b25b52393_raw_8be1198279e07364c8f72891294a5904df97133f_gistfile1.ps1
oazabir_8e3187b5756b25b52393_raw_8be1198279e07364c8f72891294a5904df97133f_gistfile1.ps1
# Build, anonymize config, deploy, zip, commit, push in one shot param ( [string]$solution = "OracleDashboard.sln", [string]$zipname = "OracleDashboard.zip", [string]$compressor = "c:\Program Files\7-Zip\7z.exe", [string]$folder = "OracleDashboard", [string]$deployPath = "..\Binary", [string]$commitF...
PowerShellCorpus/GithubGist/aaronpowell_1064060_raw_cb7101937dfd90400221d3288882a735d2d40bc6_Delete-Assemblies.ps1
aaronpowell_1064060_raw_cb7101937dfd90400221d3288882a735d2d40bc6_Delete-Assemblies.ps1
Get-ChildItem src -recurse -include *.dll | foreach ($_) { if($_.fullname.Contains("bin\")) { remove-item $_.fullname } }
PowerShellCorpus/GithubGist/xcud_4710032_raw_42870620eaf8727c97d4efb62fe387117a855a24_Get-NetworkStatistics.ps1
xcud_4710032_raw_42870620eaf8727c97d4efb62fe387117a855a24_Get-NetworkStatistics.ps1
<# .Synopsis PowerShellized netstat. Building on Shay Levy's work Shay Levy's Blog => http://blogs.microsoft.co.il/blogs/scriptfanatic/ .Example PS> Get-NetworkStatistics skype | ft -AutoSize Protocol LocalAddress LocalPort RemoteAddress RemotePort State ProcessName PID -------- ----------...
PowerShellCorpus/GithubGist/piers7_6374578_raw_ba3ce85f97d198b8244623aeeaba2e31e0e2d135_gistfile1.ps1
piers7_6374578_raw_ba3ce85f97d198b8244623aeeaba2e31e0e2d135_gistfile1.ps1
<# .Synopsis Adds/sets environment variables on the local machine for common build dependencies #> $ErrorActionPreference = 'stop'; $programFiles32 = $env:ProgramFiles if (Test-Path environment::"ProgramFiles(x86)") { $programFiles32 = (gi "Env:ProgramFiles(x86)").Value }; # Accumulate the variables that we wi...
PowerShellCorpus/GithubGist/ajkerrigan_9394792_raw_14023527bc729379b9f9cb323bc59a3045628d9c_FreshPGitSymlink.ps1
ajkerrigan_9394792_raw_14023527bc729379b9f9cb323bc59a3045628d9c_FreshPGitSymlink.ps1
# Anytime GitHub for Windows updates itself, the PortableGit pathname changes. # Powershell and GitHub for Windows handle this just fine, but explicit links # to the PortableGit installation will fail (for instance, Git binary paths # in Sublime Text packages). This little bit of code in a Powershell profile # will ens...
PowerShellCorpus/GithubGist/cointoss1973_115b1f3793bba6afeec9_raw_11efac964b09e38b4502a3ef8a5e120a30291b8e_FizzBuzz.ps1
cointoss1973_115b1f3793bba6afeec9_raw_11efac964b09e38b4502a3ef8a5e120a30291b8e_FizzBuzz.ps1
# # FizzBuzz.ps1 # Function Get-FizzBuzz($num) { $Fizz = $num % 3 $Buzz = $num % 5 if ($Fizz -eq 0 -and $Buzz -eq 0) { return "Fizz Buzz" } elseif ( $Fizz -eq 0) { return "Fizz" } elseif ( $Buzz -eq 0) { return "Buzz" } return $num } @(1..100) | % { Get-FizzBuzz $_ | Write-Host }
PowerShellCorpus/GithubGist/mbergal_7574cc35eccb3b6fb762_raw_b908332044e19dfb4a633a3e9303545d4741c145_capture.ps1
mbergal_7574cc35eccb3b6fb762_raw_b908332044e19dfb4a633a3e9303545d4741c145_capture.ps1
$clipboardImage = [System.Windows.Forms.Clipboard]::GetImage() $saveDirectory = 'c:\temp\captured' if ( $clipboardImage -ne $null ) { $existingImages = @() $existingImages = ls 'c:\temp\captured' if ( $existingImages.Length -eq 0 ) { $nextNumber = 1 } else ...
PowerShellCorpus/GithubGist/FrankDeGroot_6683854_raw_e5b6bfcf75a2307cdbb4ed2e9650a2770aa3f93d_comparelogs.ps1
FrankDeGroot_6683854_raw_e5b6bfcf75a2307cdbb4ed2e9650a2770aa3f93d_comparelogs.ps1
filter Get-LastChildItem { Join-Path $_ (gci $_ -Name | sort | select -Last 1) } $Outs = 'C:\(ProductName)\Branch\99 - bin\Deliverables\Name\Log\Compile\Compile_result.xml', "$('\\portal\DailyBuildResult\ProductName\Branch' | Get-LastChildItem | Get-LastChildItem)\CIName\Compile\compile.log" | % { ([xml](gc ...
PowerShellCorpus/GithubGist/pedromvgomes_5541933_raw_da55247db69ef1ac2030ecc9641c8ca9cb97cbad_import-jmeterResults.ps1
pedromvgomes_5541933_raw_da55247db69ef1ac2030ecc9641c8ca9cb97cbad_import-jmeterResults.ps1
# This PowerShell scripts loads the JMeter results (XML) into a given database table Param ( $provider, $connectionString, $tableName, $inputFile, $tag ) Cls Write-Host 'JMeter XML Results Importer 1.0' if ($provider -eq $null -or $connectionString -eq $null -or $tableName -eq $null ...
PowerShellCorpus/GithubGist/williamjacksn_7266828_raw_e546d17c7d63898210cbabef021f232725227453_email-daily-calendar.ps1
williamjacksn_7266828_raw_e546d17c7d63898210cbabef021f232725227453_email-daily-calendar.ps1
[CmdletBinding()] Param( [Parameter(Mandatory = $True, Position = 1)] [string]$config_file ) $config = Get-Content $config_file -Raw | ConvertFrom-Json Add-Type -Path "C:\Program Files\Microsoft\Exchange\Web Services\2.0\Microsoft.Exchange.WebServices.dll" $exch_ver = [Microsoft.Exchange.WebServices.Data...
PowerShellCorpus/GithubGist/MDendura_7c7c2f8fd7fb3cd51012_raw_b3ff841a4a208ce21702ca856f61b90ba899954b_SurfaceWin10.ps1
MDendura_7c7c2f8fd7fb3cd51012_raw_b3ff841a4a208ce21702ca856f61b90ba899954b_SurfaceWin10.ps1
#Found from here: http://answers.microsoft.com/en-us/insider/forum/insider_wintp-insider_install/windows-10-on-surface-pro-3/47b58abc-81e1-4dc9-9647-fdcfc7276299 #and here: https://twitter.com/adamucf/status/517478280014753792 #to fix some Surface issues on Windows 10 Technical Preview $code = @" using System; u...
PowerShellCorpus/GithubGist/JamesTryand_4118342_raw_44e4aeb6579fb4028ccb4b44f003c5c0fdc4beff_Get-GroupMailAddresses.ps1
JamesTryand_4118342_raw_44e4aeb6579fb4028ccb4b44f003c5c0fdc4beff_Get-GroupMailAddresses.ps1
function Get-GroupMailAddresses { PARAM([string[]]$GroupName) BEGIN { $DSGroupNameBasis = { PARAM([string]$Name) PROCESS { "(&(groupType=-2147483646)(name=$Name))" } } } PROCESS { (new-object DirectoryServices.DirectorySearcher( & $DSGroupNameBasis -Name $GroupName )). ...
PowerShellCorpus/GithubGist/lantrix_62450df9ab94e68d7992_raw_47d6218c61af1487fff52f555f73ecdd956b35e6_create_striped_volume.ps1
lantrix_62450df9ab94e68d7992_raw_47d6218c61af1487fff52f555f73ecdd956b35e6_create_striped_volume.ps1
# # Create Striped Volume set from (Available) Raw Disks # #settings $letter = "E" #Drive Letter $allocation = 65536 #Blocksize in Bytes $label = "My Disk Label" #drive label #Get started $disks = get-disk |where partitionstyle -eq 'raw' if ($disks.Count -lt 2) {throw "Not Enough RAW disks"} #Prepare ...
PowerShellCorpus/GithubGist/sneal_eeb52e859186ba44163d_raw_f2d90d497c8e77883fa2d54565d8ee4cbfde252c_install-vmware-tools.ps1
sneal_eeb52e859186ba44163d_raw_f2d90d497c8e77883fa2d54565d8ee4cbfde252c_install-vmware-tools.ps1
$version = '9.6.1' # from /Applications/VMware Fusion.app/Contents/Library/isoimages/windows.iso $iso_name = 'vmware_fusion_tools_windows_6.0.3.iso' $download_url = "http://host.example.com/$iso_name" (New-Object System.Net.WebClient).DownloadFile($download_url, "c:\windows\temp\$iso_name") &c:\7-zip\7z.exe x ...
PowerShellCorpus/GithubGist/ot-joe-ocampo_3948174_raw_ca8fcdcf83c87f87015589f45876da2b6c1df77f_profile.ps1
ot-joe-ocampo_3948174_raw_ca8fcdcf83c87f87015589f45876da2b6c1df77f_profile.ps1
# Configure Path $GitInstallDir = 'C:\Program Files (x86)\Git' $NotepadPlusDir = 'C:\Program Files (x86)\Notepad++\' $Env:Path = "$NotepadPlusDir;$GitInstallDir\bin;$Env:Path" if(!$Env:HOME) { $Env:HOME = "$Env:HOMEDRIVE$Env:HOMEPATH" } if(!$Env:HOME) { $Env:HOME = $Env:USERPROFILE } $Env:PLINK_PROTOCOL = 'ssh' ...
PowerShellCorpus/GithubGist/wpsmith_8d4acea64423543da32e_raw_0057345c81061c9ffb6bd1eaf52aaf063c4fbf54_upload-spfile.ps1
wpsmith_8d4acea64423543da32e_raw_0057345c81061c9ffb6bd1eaf52aaf063c4fbf54_upload-spfile.ps1
[CmdletBinding()] Param( # SharePoint Document Library Name, e.g., "Site Documents" [Parameter(Mandatory=$True)] [string]$docLibrary, # Path to the local file, "C:\Documents\" # Include trailing slash [Parameter(Mandatory=$True)] [string]$filePath, # File name, e.g., myfi...
PowerShellCorpus/GithubGist/tugberkugurlu_4223730_raw_822fff60c13ad7e6edb560e5c388788fdd5e5b50_Deploy.ps1
tugberkugurlu_4223730_raw_822fff60c13ad7e6edb560e5c388788fdd5e5b50_Deploy.ps1
param( $subscriptionId = $env:PINGYOURPACKAGE_AZURE_SUBSCRIPTION_ID, $certificateThumbprint = $env:PINGYOURPACKAGE_MANAGEMENT_CERTIFICATE_THUMBPRINT, $serviceName = $env:PINGYOURPACKAGE_AZURE_SERVICE_NAME, $storageServiceName = ...
PowerShellCorpus/GithubGist/jokcofbut_990d0ddc837ca724953a_raw_65f1a95fa0cca964458972ed80d01d663b198034_Yo.ps1
jokcofbut_990d0ddc837ca724953a_raw_65f1a95fa0cca964458972ed80d01d663b198034_Yo.ps1
param([string] $expression) Invoke-Expression $expression $url = "http://api.justyo.co/yoall/" $body = @{ api_token = "YOUR-KEY" } Invoke-RestMethod -Method Post -Uri $url -Body $body
PowerShellCorpus/GithubGist/ser1zw_4366363_raw_1f1262b5eb618dce2c2213f540aa38e1ab035925_send.ps1
ser1zw_4366363_raw_1f1262b5eb618dce2c2213f540aa38e1ab035925_send.ps1
################################################################################ # Send E-mail from eml file in PowerShell # Tested on PowerShell 2.0 # # Usage: # 1. Configure the variables defined in Main() # $server = "localhost" # $port = "25" # $mailfrom = "from@example.com" # $rcptto = "to@exa...
PowerShellCorpus/GithubGist/RhysC_848255_raw_1f24facc6cfd696d9232101f462a5d1feb81a04f_MachineAudit.ps1
RhysC_848255_raw_1f24facc6cfd696d9232101f462a5d1feb81a04f_MachineAudit.ps1
#Audit script $auditFile = "audit.txt" $computername = "." #i.e local machine "Computer name $computername" > $auditFile "Computer details:" >> $auditFile get-wmiobject Win32_ComputerSystem -computername $computername | select Name, Manufacturer, Model,` NumberOfProcessors, TotalPhysicalMemory, ` ...
PowerShellCorpus/GithubGist/andreagx_9067720_raw_72aac39842f388a6c2bfb8d4b2a0e56534d2c1c6_OWA_Sigature.ps1
andreagx_9067720_raw_72aac39842f388a6c2bfb8d4b2a0e56534d2c1c6_OWA_Sigature.ps1
# OWA Signature import by Andrea Gallazzi www.andreagallazzi.com #var old is text to remove $old = 'src=".+?_file/image001.gif"' #var $new = the text you want to replace $new = 'src="http://www.mypublicwebsite.com/image001.gif"' #change the Get-ChildItem to a folder or your choice Get-ChildItem C:\Signatures\*.htm ...
PowerShellCorpus/GithubGist/jacobludriks_a9fa14f95038e3b41952_raw_0a256826a1a44b951f345ddc8ad538672c178a5d_send-nexmosms.ps1
jacobludriks_a9fa14f95038e3b41952_raw_0a256826a1a44b951f345ddc8ad538672c178a5d_send-nexmosms.ps1
Function Send-NexmoSMS { Param( [Parameter(Mandatory=$true)] [string]$APIKey, [Parameter(Mandatory=$true)] [string]$APISecret, [Parameter(Mandatory=$true)] [string]$From, [Parameter(Mandatory=$true)] [string]$To, [Parameter(Mandatory=$true)] [string]$Text ) if (!($to -match '\+(9[976...
PowerShellCorpus/GithubGist/algu_4128319_raw_4300c845f3f2d922efd45b2e27e034416f09feb5_extensionAttribute_migration.ps1
algu_4128319_raw_4300c845f3f2d922efd45b2e27e034416f09feb5_extensionAttribute_migration.ps1
# AD extensionAttribute migration between different forests # # Aleksey Gupa at 22/11/2012 00:38 # # 1. read all users from $SearchOU (for example $SearchOU ="test.local/Country/BE/" # 2. get their extensionAttribute5 # 3. if extensionAttribute is a network path to some picture # (like "\\NAS5GE003\images\picture00...
PowerShellCorpus/GithubGist/phantomtypist_7391669aad234a773a23_raw_57cbc164a4d7a61d9fa86bc70afb8fa61d022653_Boxstarter-03-Software-Development.ps1
phantomtypist_7391669aad234a773a23_raw_57cbc164a4d7a61d9fa86bc70afb8fa61d022653_Boxstarter-03-Software-Development.ps1
# http://boxstarter.org/package/url? # Source Control cinst git.install cinst msysgit cinst poshgit cinst git-credential-winstore -Version 1.2.0.0 cinst gitextensions cinst tortoisegit cinst tortoisehg cinst githubforwindows if (Test-PendingReboot) { Invoke-Reboot...
PowerShellCorpus/GithubGist/seafoox_4348d37828208c86713d_raw_5fb0bc6d8cdf57981f8e4d52809c414e68c70daa_gistfile1.ps1
seafoox_4348d37828208c86713d_raw_5fb0bc6d8cdf57981f8e4d52809c414e68c70daa_gistfile1.ps1
# Open terminal and type defaults write com.google.Chrome.plist AppleEnableSwipeNavigateWithScrolls -bool FALSE # For mavericks defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool FALSE
PowerShellCorpus/GithubGist/Retro2707_7295270_raw_cacfb4f6cca129851fbedb9392d2ed4cd26f96e7_get-info.ps1
Retro2707_7295270_raw_cacfb4f6cca129851fbedb9392d2ed4cd26f96e7_get-info.ps1
<# .SYNOPSIS Retrieves info from one or more computers. .PARAMETER computername The computer name(s) to retrieve the info from. .PARAMETER logfile The path and filename of a text file where failed computers will be logged. Defaults to c:\retries.txt. .EXAMPLE ...
PowerShellCorpus/GithubGist/talatham_5765965_raw_ce070afb78e4ff1c98c3d058bb9c62f0b9aec19e_openfile.ps1
talatham_5765965_raw_ce070afb78e4ff1c98c3d058bb9c62f0b9aec19e_openfile.ps1
# ---------- FUNCTION ------------- Function Get-FileName # Open file dialog box and select a file to import { [void][System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") $OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog $OpenFileDialog.filter = "Text Files (*...
PowerShellCorpus/GithubGist/sempervictus_6076104_raw_7d3fd7272cd613e4a27aaf0e357fe2cf353d624a_gistfile1.ps1
sempervictus_6076104_raw_7d3fd7272cd613e4a27aaf0e357fe2cf353d624a_gistfile1.ps1
[Environment]::SetEnvironmentVariable("PshStub", "#{code}", "User") Invoke-Expression $($([Text.Encoding]::Unicode.GetString([Environment]::GetEnvironmentVariable("PshStub","User")))
PowerShellCorpus/GithubGist/theagreeablecow_2780747_raw_dc5e643ce111a358f1534f1a336aed521834c4b1_setupnewuser.ps1
theagreeablecow_2780747_raw_dc5e643ce111a358f1534f1a336aed521834c4b1_setupnewuser.ps1
# This script will set up AD, User Directories, Exchange and Lync, using basic data retrived from a CSV file # Requires the Active Directory module for Windows Powershell and appropriate credentials # CSV file with corresponding header and user(s) info: # Office,UserName,FirstName,LastName,Initial,Department,Role,...
PowerShellCorpus/GithubGist/jonforums_5080257_raw_3b6befffc826372fd54cf5eb8e7c0f7d29c13119_build_tcltk.ps1
jonforums_5080257_raw_3b6befffc826372fd54cf5eb8e7c0f7d29c13119_build_tcltk.ps1
#requires -version 2.0 # Author: Jon Maken # License: 3-clause BSD # Revision: 2013-03-04 18:48:14 -0600 # # TODO: # - extract generics into a downloadable utils helper module # - add try-catch-finally error handling # - add checkpoint support # - support x86 and x64 builds (configure's --enable-64bi...
PowerShellCorpus/GithubGist/ovu_a65b11868d4e8e8078d9_raw_84847381a3a206dffc39719d832c0809d8368c76_gistfile1.ps1
ovu_a65b11868d4e8e8078d9_raw_84847381a3a206dffc39719d832c0809d8368c76_gistfile1.ps1
function prompt { $gitbranch = & git rev-parse --abbrev-ref HEAD if ($gitbranch) { Write-Host $(Get-Location) -NoNewLine Write-Host '[' -NoNewLine Write-Host $gitbranch -NoNewLine -ForeGround 6 Write-Host ']' -NoNewLine Write-Host ' ->' -NoNewLine -ForeGround Green } ...
PowerShellCorpus/GithubGist/GuruAnt_7215386_raw_5b414ed90b05d5566391e260c64a449dfd46335a_CheckIfServerOnListIsAVM.ps1
GuruAnt_7215386_raw_5b414ed90b05d5566391e260c64a449dfd46335a_CheckIfServerOnListIsAVM.ps1
# Check if Servers on Text List exist on VMware # Assumes that the VM object name matches the server's DNS name # Set this to the text file containing the list of servers, one per line $strServerList = "C:\path\to\textFile.txt" # Create empty array for servers which are found $arrFoundServers = @() # Assign...
PowerShellCorpus/GithubGist/Porkstone_3722751_raw_c957fedd3827e335ee1184a542bf1d81f2c62350_Search.ps1
Porkstone_3722751_raw_c957fedd3827e335ee1184a542bf1d81f2c62350_Search.ps1
# Example Usage: # Search "*.cs" "classname" function Search ($FileMask, $SearchString) { dir -filter $FileMask -recurse | select-string $SearchString }
PowerShellCorpus/GithubGist/nzthiago_5899989_raw_a788e959d9f7d6912e0cec1bd9c8b4a7a9d0b165_downloadBUILD2013.ps1
nzthiago_5899989_raw_a788e959d9f7d6912e0cec1bd9c8b4a7a9d0b165_downloadBUILD2013.ps1
# Based on script from http://www.toddklindt.com/Scripts/downloadmp4-pptx.ps1.txt [Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath $rss = (new-object net.webclient) # Grab the RSS feed for the MP4 downloads $a = ([xml]$rss.downloadstring("http://channel9.msdn.com/Events/Build/...
PowerShellCorpus/GithubGist/gpolitis_4371379_raw_95339e03af550083ccff5981b35b10a6dc4c3d85_gistfile1.ps1
gpolitis_4371379_raw_95339e03af550083ccff5981b35b10a6dc4c3d85_gistfile1.ps1
$cue = 'c:\Users\gp\example.cue' $patt = '(?smi)TITLE\s"([^"]*)"(?:\n|\s)*PERFORMER\s*"([^"]*)"' cat $cue -Raw | sls -patt $patt -AllMatches | % { $_.Matches } | % { New-Object -Property @{ Title = $_.Groups[1].Value; Artist = $_.Groups[2].Value } } | % { "\track {0} - {1}" -f $_.Artist, $_.Title } ...
PowerShellCorpus/GithubGist/zachbonham_4982148_raw_08da9b884b480aa5c008fee52cd2a6b191ce1694_driver.ps1
zachbonham_4982148_raw_08da9b884b480aa5c008fee52cd2a6b191ce1694_driver.ps1
$arg1 = "hello1" $arg2 = "hello2" $p = $(start-process -filepath .\bin\debug\hello.exe -argumentlist $arg1 -nonewwindow -passthru; start-process -filepath .\bin\debug\hello.exe -argumentlist $arg2 -nonewwindow -passthru); #$p | wait-process [console]::TreatControlCAsInput = $true while($true) { if ( [co...
PowerShellCorpus/GithubGist/mwrock_481048e7de5074e38b7f_raw_d0b9057164e085c50e4d2ef6e736a5eba2e6d06c_nuspec.ps1
mwrock_481048e7de5074e38b7f_raw_d0b9057164e085c50e4d2ef6e736a5eba2e6d06c_nuspec.ps1
@{ version = '11.0.1' authors = @('Microsoft') owners = @('Matt Wrock') projectUrl = 'http://www.microsoft.com/visualstudio/11/en-us' licenseUrl = 'http://msdn.microsoft.com/en-US/cc300389.aspx' iconUrl = 'https://github.com/mwrock/Chocolatey-Packages/raw/master/VisualStudio2012Ultimate/vs...
PowerShellCorpus/GithubGist/mbrownnycnyc_6511499_raw_dfcea19a047e7c55bbf1140b0e31b8c81596f148_uninstall_string_getter.ps1
mbrownnycnyc_6511499_raw_dfcea19a047e7c55bbf1140b0e31b8c81596f148_uninstall_string_getter.ps1
$global:debug = $false $global:debugverbose = $false Function GetUninstallString([string]$computername, $displayname) { try { #first, we'll grab a collection of key names below HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall for 64 bit #we'll search for the DisplayNam...
PowerShellCorpus/GithubGist/guitarrapc_2b1871a54ffe786c6b36_raw_de0c2c18db7a23a06ac0a13fb231884d5635be2b_RunwithConfiguraionData.ps1
guitarrapc_2b1871a54ffe786c6b36_raw_de0c2c18db7a23a06ac0a13fb231884d5635be2b_RunwithConfiguraionData.ps1
Service -ConfigurationData $configuraionData -OutputPath service
PowerShellCorpus/GithubGist/jpoehls_1077968_raw_a85260997a1440f85097445374163947bf8b2113_Hg-Export.ps1
jpoehls_1077968_raw_a85260997a1440f85097445374163947bf8b2113_Hg-Export.ps1
function Hg-Export([string]$Path) { <# .SYNOPSIS Exports all uncommitted changes in the current HG repository to a git formatted diff file at the specified path. The resultant diff file can be re-imported into a repo using: hg import changes.diff .EXAMPLE Hg-Export changes.diff # equivelant to: ...
PowerShellCorpus/GithubGist/guitarrapc_128716059fee41846e8f_raw_6f9b25604ecaef2aec5d4ab843d09bfd30129d14_ConfigurationUserAndGroupSample.ps1
guitarrapc_128716059fee41846e8f_raw_6f9b25604ecaef2aec5d4ab843d09bfd30129d14_ConfigurationUserAndGroupSample.ps1
Configuration Remote { param ( [Parameter(Mandatory = 1, Position = 0)] [pscredential]$Credential ) User Remote { UserName = $Credential.UserName Ensure = "Present" Password = $Credential Disabled = $false PasswordNeverExpires = ...
PowerShellCorpus/GithubGist/togakangaroo_7357291_raw_a210e92ef70c9cbd00aa7680f8c1d308b4789d7e_Transfer-SvnToHgCommits.ps1
togakangaroo_7357291_raw_a210e92ef70c9cbd00aa7680f8c1d308b4789d7e_Transfer-SvnToHgCommits.ps1
<# .SYNOPSIS Check out a range of Subversion revisions and recommit them to Mercurial .DESCRIPTION In the case where you already have an svn and an hg repository and you are transferring commits from one to the other (this is relevant when slowly transitioning svn to hg) you might get in a situation where ...
PowerShellCorpus/GithubGist/johnkors_5501060_raw_8c2df4c7abf4c584333513e345948cf3763d9d09_gistfile1.ps1
johnkors_5501060_raw_8c2df4c7abf4c584333513e345948cf3763d9d09_gistfile1.ps1
# helper to update ps sessions env variables function Update-Environment { $locations = 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'HKCU:\Environment' $locations | ForEach-Object { $k = Get-Item $_ $k.GetValueNames() | ForEach-Object { ...
PowerShellCorpus/GithubGist/grenade_7639518_raw_21ca05278888283075da5b28dca295ff470f35b6_EnablePowerShellNet4.ps1
grenade_7639518_raw_21ca05278888283075da5b28dca295ff470f35b6_EnablePowerShellNet4.ps1
$windowsIdentity = [System.Security.Principal.WindowsIdentity]::GetCurrent() $windowsPrincipal = New-Object System.Security.Principal.WindowsPrincipal($windowsIdentity) $adminRole = [System.Security.Principal.WindowsBuiltInRole]::Administrator if (!($windowsPrincipal.IsInRole($adminRole))) { $psi = new-object Syst...
PowerShellCorpus/GithubGist/vScripter_84faa2dd6a7c0a9ae105_raw_cbaecdceb08bcf730521e78bb37fa1d7d13fff58_Set-ConsoleWindowTitle.ps1
vScripter_84faa2dd6a7c0a9ae105_raw_cbaecdceb08bcf730521e78bb37fa1d7d13fff58_Set-ConsoleWindowTitle.ps1
function Set-ConsoleWindowTitle { [cmdletbinding()] param ( [parameter(Mandatory = $true, Position = 0, ParameterSetName = 'Default')] [validateset("Default", "Custom")] [string]$MessageType, [parameter(Mandatory = $false, Position = 1, ParameterSetName = 'Default'...
PowerShellCorpus/GithubGist/MatthewKing_6374590_raw_73573089ca242ce2d947b3e982ca20829a524291_count-loc.ps1
MatthewKing_6374590_raw_73573089ca242ce2d947b3e982ca20829a524291_count-loc.ps1
(Get-ChildItem -include *.cs -recurse | Select-String .).Count
PowerShellCorpus/GithubGist/antonydenyer_6087279_raw_1dbe68be9b19e039958b74e2dfd2a78565b885b4_OctoChef.ps1
antonydenyer_6087279_raw_1dbe68be9b19e039958b74e2dfd2a78565b885b4_OctoChef.ps1
param( [parameter(Mandatory = $true)] $packageName ) $currentDirectory=$pwd function CreateTempDir { $tmpDir = [System.IO.Path]::GetTempPath() $tmpDir = [System.IO.Path]::Combine($tmpDir, [System.IO.Path]::GetRandomFileName()) [System.IO.Directory]::CreateDirectory($tmpDir) | Out-Null $tmpDir } $tmp...
PowerShellCorpus/GithubGist/Romoku_4004215_raw_d5ce9a20b20ee459e5ff52d49bbefa1dc0057ce2_utorrent.ps1
Romoku_4004215_raw_d5ce9a20b20ee459e5ff52d49bbefa1dc0057ce2_utorrent.ps1
param( [String]$filePath="", [String]$fileName="" ) $encoderDirectory = "c:\temp\done" $encoder = "C:\temp\done\sample.bat" $extension = "*.jnt" Function StripChar($s) { $s.replace(" ","_").replace(",","_").replace("~","_").replace("#", "_") } Function MoveFile($filePath, $fileName) { $newPath = ...
PowerShellCorpus/GithubGist/weipah_4169900_raw_a7093ffe35f4f15b3050b787350386fa42a4bbf6_findUserOnTerminalServer.ps1
weipah_4169900_raw_a7093ffe35f4f15b3050b787350386fa42a4bbf6_findUserOnTerminalServer.ps1
#require -version 2.0 # based on source from: http://www.nivot.org/blog/post.aspx?id=1f8255b2-05a7-4947-8dc3-01ce3c478cc2 # does not really work, because the waithandle is not processed correctly # using $wait[$i].WaitOne() in for-loop would work, but is not the right way to process jobs in parallel # create...
PowerShellCorpus/GithubGist/johnmiller_172753ed0adaca866a81_raw_f9245e2dafa390d7fb581dc2ce276eae85c4077a_show-all-project-branches.ps1
johnmiller_172753ed0adaca866a81_raw_f9245e2dafa390d7fb581dc2ce276eae85c4077a_show-all-project-branches.ps1
function show-all-project-branches { $Workspace = "C:\Workspace\" $InitialLocation = Get-Location function show-repo-branch($dir) { $GitDir = $dir.FullName + "\.git" $IsRepository = Test-Path $GitDir if (!$IsRepository) { return } cd $dir.FullName $CurrentBranch = git rev-parse --abbr...
PowerShellCorpus/GithubGist/constructor-igor_18e88b456833f3dc9d7f_raw_d8dd8b7db56cf576250b7bc9980af5d6792390f7_gistfile1.ps1
constructor-igor_18e88b456833f3dc9d7f_raw_d8dd8b7db56cf576250b7bc9980af5d6792390f7_gistfile1.ps1
# # sample: #$title = "MyChart" #$size = "700x350" #$url = CreateChartUrl $valueArray $labelArray $title $size # function CreateChartUrl ($valueArray, $labelArray, [string]$title, $size) { $chartType = "lc" $chartData = [string]::join(",", $valueArray) $chartLabel = [string]::join("|", $labelArr...
PowerShellCorpus/GithubGist/Yoos01_a1fe1784362d7b8042d1_raw_d5c19e49df8c42fb5f3927cc40000f1182e852b0_gistfile1.ps1
Yoos01_a1fe1784362d7b8042d1_raw_d5c19e49df8c42fb5f3927cc40000f1182e852b0_gistfile1.ps1
#Script principale write-host "Renommage du poste" $Answer="n" Do{ $CompName = read-host "Veuillez saisir le nom du poste" Write-Host "Vous avez saisis comme nom de poste : $CompName" $Answer = read-host "Voulez vous poursuivre y/n ?" }while ($Answer -ne "y" -and $Answer -ne "Y") RenameComputer -C...
PowerShellCorpus/GithubGist/andreaswasita_71eb3894abf4379b3b7e_raw_e959ba34f90a3bb0c54d59455e3095cfa76bd8f7_Add-AzureVMAntiMalware.ps1
andreaswasita_71eb3894abf4379b3b7e_raw_e959ba34f90a3bb0c54d59455e3095cfa76bd8f7_Add-AzureVMAntiMalware.ps1
$service= "AzureVMAntiMalware" $name = "MyAzureVM01" # Get the Azure VM $vm = Get-AzureVM –ServiceName $service –Name $name # Add Microsoft Antimalware Agent to Azure VM Set-AzureVMExtension -Publisher Microsoft.Azure.Security -ExtensionName IaaSAntimalware -Version 1.* -VM $vm.VM # Update the VM which will install ...
PowerShellCorpus/GithubGist/yogex_2857140_raw_0ccf27cc76cb785d2682330a152824b70eac92c3_ssh-agent-utils.ps1
yogex_2857140_raw_0ccf27cc76cb785d2682330a152824b70eac92c3_ssh-agent-utils.ps1
# SSH Agent Functions # Mark Embling (http://www.markembling.info/) # # How to use: # - Place this file into %USERPROFILE%\Documents\WindowsPowershell (or location of choice) # - Import into your profile.ps1: # e.g. ". (Resolve-Path ~/Documents/WindowsPowershell/ssh-agent-utils.ps1)" [without quotes] # - Enjoy...
PowerShellCorpus/GithubGist/miriyagi_6699897_raw_94cc74b2aeca2f22de089d46befa8e648d7b386b_Remove-DuplicatedMusicFiles.ps1
miriyagi_6699897_raw_94cc74b2aeca2f22de089d46befa8e648d7b386b_Remove-DuplicatedMusicFiles.ps1
Get-ChildItem -Hidden -Recurse . | %{ [string] $originalFileName = (($_.FullName -replace ' 1\.m4a$', '.m4a') -replace '-YUKI\.m4a', '.m4a') if ($originalFileName -ne $_.FullName -and (Test-Path -LiteralPath $originalFileName)) { Remove-Item -Force -LiteralPath $_.FullName } }
PowerShellCorpus/GithubGist/smasterson_25862683c8f822917177_raw_fec373d9f466d1b063c20f8d73c40f9f2cdd327c_Get-VMHostInfo.ps1
smasterson_25862683c8f822917177_raw_fec373d9f466d1b063c20f8d73c40f9f2cdd327c_Get-VMHostInfo.ps1
#Requires –Version 3 #Requires -PSSnapin VMware.VimAutomation.Core <# .SYNOPSIS Exports VMware host (ESX/ESXi) information to Excel .DESCRIPTION Queries one or more ESX/ESXi servers directly and exports all info to an Excel workbook A new workbook/file will be created for each host .PARAMETER...
PowerShellCorpus/GithubGist/Gethe_7617988_raw_99a8d36128f82bc80d2102145c8e8df69a22bae3_wow%20patch.ps1
Gethe_7617988_raw_99a8d36128f82bc80d2102145c8e8df69a22bae3_wow%20patch.ps1
### Options ### #valid modes: live, ptr, beta $mode = "ptr" $locale = "enUS" ### End Options ### [int]$build = Read-Host "What build do you want to start at?" #17595 if ($mode -eq "live") { $basicURL = "http://ak.worldofwarcraft.com.edgesuite.net/wow-pod-retail/NA/15890.direct" } elseif ($mode -eq ...
PowerShellCorpus/GithubGist/adoprog_5605387_raw_dc48002eaeeff9f1bcfba3567598487a16bf49c2_gistfile1.ps1
adoprog_5605387_raw_dc48002eaeeff9f1bcfba3567598487a16bf49c2_gistfile1.ps1
Clear-Host remove-module [p]sake import-module .\Tools\psake\psake.psm1 $psake.use_exit_on_error = $true Invoke-psake .\buildscript.ps1 Package -properties @{ buildNumber = '12345'; }
PowerShellCorpus/GithubGist/StevenMcD_4008594_raw_a93339004453e006c5b6f46fd8729c682864e2f4_TeamCity_helperFunctions.ps1
StevenMcD_4008594_raw_a93339004453e006c5b6f46fd8729c682864e2f4_TeamCity_helperFunctions.ps1
############################# # Mercilessly copied from https://github.com/kvarv/Continuous-Delivery ############################# function TeamCity-TestSuiteStarted([string]$name) { Write-Output "##teamcity[testSuiteStarted name='$name']" } function TeamCity-TestSuiteFinished([string]$name) { Write-Output...
PowerShellCorpus/GithubGist/talesin_f1f57242e2d367a6a539_raw_0c52313fb6e8cf5a24da90447829b683f9933ee0_vs.ps1
talesin_f1f57242e2d367a6a539_raw_0c52313fb6e8cf5a24da90447829b683f9933ee0_vs.ps1
function vs { param($Path = ".") if ($Path -inotmatch "\.sln$") { $Path = Join-Path $Path "*.sln" } dir -ErrorAction SilentlyContinue -recurse *.sln | &{ $d = @($input) if ($d.Count -eq 1) { $d[0] } elseif ($d.Count -eq 0) { $null } else { $choice = Read-Host ("Please select a s...
PowerShellCorpus/GithubGist/alienone_3f21fcd376187bd8871a_raw_1106521efbc04af855188b5f07e82f461b650cda_adjust_firewall.ps1
alienone_3f21fcd376187bd8871a_raw_1106521efbc04af855188b5f07e82f461b650cda_adjust_firewall.ps1
New-NetFirewallRule -DisplayName "ISP MQ Series" -Group "ISP" -Direction Inbound -Protocol TCP -LocalPort 1414, 1415 -Program "D:\mqm\bin\runmqlsr.exe (file:///D:/mqm/bin/runmqlsr.exe)" -Action Allow
PowerShellCorpus/GithubGist/tkmtmkt_2948484_raw_2c08fd8f81396e43f6f59989175081b198a269fe_gistfile1.ps1
tkmtmkt_2948484_raw_2c08fd8f81396e43f6f59989175081b198a269fe_gistfile1.ps1
gwmi -Namespace root\wmi WmiMonitorID | %{ New-Object PSObject -Property @{ ManufacturerName = -join ($_.ManufacturerName | %{[char]$_}) ProductCodeID = -join ($_.ProductCodeID | %{[char]$_}) SerialNumberID = -join ($_.SerialNumberID | %{[char]$_}) UserFriendlyName ...
PowerShellCorpus/GithubGist/guitarrapc_df61ae6b1080cc676d5c_raw_8e09257a4864cb8453be79a3812faf41008caf03_return%E3%81%AE%E7%BD%A0.ps1
guitarrapc_df61ae6b1080cc676d5c_raw_8e09257a4864cb8453be79a3812faf41008caf03_return%E3%81%AE%E7%BD%A0.ps1
1..3 | %{ return $_ $_ } <# 1 2 3 #> foreach ($x in (1..3)) { return $x $x } <# 1 #>
PowerShellCorpus/GithubGist/janikvonrotz_6622205_raw_a04167017b6f7deb42ca154827485c9d60956426_Sync-GitHubGists.ps1
janikvonrotz_6622205_raw_a04167017b6f7deb42ca154827485c9d60956426_Sync-GitHubGists.ps1
[System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions") function Sync-GitHubGists{ param( [string[]]$Url, [string]$Path ) # settings $TagFileName = "Tags.txt" $GithubGists = $null $Url | %{ # get json $WebCli...
PowerShellCorpus/GithubGist/andrebocchini_4376306_raw_9845580a537dda9275d1ba310703e7e747e0290e_Find-RunningProcess.ps1
andrebocchini_4376306_raw_9845580a537dda9275d1ba310703e7e747e0290e_Find-RunningProcess.ps1
param( [parameter(Mandatory=$true,ValueFromPipeline=$true)]$computerNameList, [parameter(Mandatory=$true)]$processName ) foreach($computerName in $computerNameList) { try { $process = Get-Process -ComputerName $computerName | Where { $_.Name -like "$processName" } | Select-Object MachineName,Name,I...
PowerShellCorpus/GithubGist/Vidanez_8d70df70e91c5d1103fc_raw_2eca53ab8aab87d3c4d7a894b31fa5f290e1debd_DeployVM.ps1
Vidanez_8d70df70e91c5d1103fc_raw_2eca53ab8aab87d3c4d7a894b31fa5f290e1debd_DeployVM.ps1
<# .SYNOPSIS Deploy Multiple VMs to vCenter .DESCRIPTION VMs are deployed asynchronously based on a pre-configured csv file (DeployVM.csv) Designed to run from Powershell ISE .PARAMETER csvfile Path to DeployVM.csv file with new VM info .PARAMETER vCenter vCenter Server FQDN or IP .PARAMETER auto Wi...
PowerShellCorpus/GithubGist/meadhikari_a677fa835ee3b73a3d3f_raw_6f7f35ea4ecc3218cc9c8d2a795c3176b0333291_deactivate.ps1
meadhikari_a677fa835ee3b73a3d3f_raw_6f7f35ea4ecc3218cc9c8d2a795c3176b0333291_deactivate.ps1
$connection = new-object System.Data.SqlClient.SQLConnection("Data Source=.;Integrated Security=SSPI;Initial Catalog=aspnetdb"); $cmd = new-object System.Data.SqlClient.SqlCommand("UPDATE dbo.aspnet_Membership SET IsApproved = 0 where LastLoginDate < DATEADD(DAY, -30, GETDATE())", $connection); $connection.Open(); ...
PowerShellCorpus/GithubGist/gilmation_466630_raw_4554a8e5d96549ff0a4a94e6310cc40fffa08fbe_Microsoft.PowerShell_profile.ps1
gilmation_466630_raw_4554a8e5d96549ff0a4a94e6310cc40fffa08fbe_Microsoft.PowerShell_profile.ps1
# Set the execution policy Set-ExecutionPolicy RemoteSigned # Set up functions # To use this profile the following environment variables must exist: # They can be created by substituting: # $VALUE for the value that you want for each variable # The third argument can be either of Process|User|Machine. # Pro...
PowerShellCorpus/GithubGist/guitarrapc_670ff96a2a3966613a0d_raw_634c6ced8a7438af5377ed0043906d67df76264a_InvalidOutputType.ps1
guitarrapc_670ff96a2a3966613a0d_raw_634c6ced8a7438af5377ed0043906d67df76264a_InvalidOutputType.ps1
function nyao { [OutputType([int])] [CmdletBinding()] param() return [uri]"http://google.com" }
PowerShellCorpus/GithubGist/fishnugget77_4151288_raw_9ad2b9e66033bdb175e560580b8ea46e0f737fa5_post-build.ps1
fishnugget77_4151288_raw_9ad2b9e66033bdb175e560580b8ea46e0f737fa5_post-build.ps1
mkdir "%USERPROFILE%\RightNowDev" mkdir "%USERPROFILE%\RightNowDev\AddIns" mkdir "%USERPROFILE%\RightNowDev\AddIns\$(TargetName)" copy /Y "$(TargetDir)$(TargetName).*" "%USERPROFILE%\RightNowDev\AddIns\$(TargetName)\"
PowerShellCorpus/GithubGist/smasterson_9141509_raw_623fd4dacc566a27269713176c50bf52f7ff5273_VeeamSingleBackup.ps1
smasterson_9141509_raw_623fd4dacc566a27269713176c50bf52f7ff5273_VeeamSingleBackup.ps1
# Load Veeam snapin Add-PsSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue Clear-Host Write-Host "VM must be explicitly defined in the job" Write-Host "VM can not be inherited by a folder, datastore or other object or it will get excluded as well and job will be empty." Write-Host "" Write-Host "Always...
PowerShellCorpus/GithubGist/thoemmi_2937183_raw_40ffb1851a4d9bce1ac09704f335dc27472bfd15_Add-XmlFragment.ps1
thoemmi_2937183_raw_40ffb1851a4d9bce1ac09704f335dc27472bfd15_Add-XmlFragment.ps1
<# .SYNOPSIS Adds an XML fragment to an XmlNode .DESCRIPTION Adds an XML fragment to an XmlNode .NOTES Author : Thomas Freudenberg - info@thomasfreudenberg.com .EXAMPLE Add-XmlFragment $xml.configuration.connectionStrings "<add name='MyConString' connectionString='...' pro...
PowerShellCorpus/GithubGist/rbocchinfuso_9368894_raw_59beb30c7c3acec04579e1b84ae1e5ed7f7fb414_check_vm_snaps.ps1
rbocchinfuso_9368894_raw_59beb30c7c3acec04579e1b84ae1e5ed7f7fb414_check_vm_snaps.ps1
# PowerShell script to check for VM snapshots and send Email report add-pssnapin VMware.VimAutomation.Core Connect-VIServer -Server 'vcenter' -User 'domain\user' -Password 'password' # HTML formatting $a = "<style>" $a = $a + "BODY{background-color:white;}" $a = $a + "TABLE{border-width: 1px;border-style: sol...
PowerShellCorpus/GithubGist/thiagowfx_7223952_raw_bd78c26a96b71739f532f54a0ba35b2655771523_gistfile1.ps1
thiagowfx_7223952_raw_bd78c26a96b71739f532f54a0ba35b2655771523_gistfile1.ps1
# move openbox config dir to github repo mv ~/.config/openbox ~/git/openbox # symlink back ln -s ~/git/openbox/openbox ~/.config/openbox
PowerShellCorpus/GithubGist/andrebocchini_6368082_raw_26edb8d6e5f22f0a901161c48aed1961f3d5558b_gistfile1.ps1
andrebocchini_6368082_raw_26edb8d6e5f22f0a901161c48aed1961f3d5558b_gistfile1.ps1
Function New-SCCMSupportedPlatform { [CmdletBinding()] param( [parameter(Mandatory=$true, Position=0)] [ValidateNotNullOrEmpty()] [string] $name, [parameter(Mandatory=$true, Position=1)] [ValidateNotNullOrEmpty()] [string] $maxVersion, [par...