full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/GithubGist/micdenny_264c5d02f31b246f475c_raw_3195da8afc32e82ee94aa8306a4ea144cb6d10eb_download-entries.ps1
micdenny_264c5d02f31b246f475c_raw_3195da8afc32e82ee94aa8306a4ea144cb6d10eb_download-entries.ps1
# --- settings --- $feedUrlBase = "https://www.nuget.org/api/v2/" # 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" # --- locals --- $we...
PowerShellCorpus/GithubGist/fgarcia_8451635_raw_f75650e1a0fd7b4be4fb757389a12753d74067d2_gistfile1.ps1
fgarcia_8451635_raw_f75650e1a0fd7b4be4fb757389a12753d74067d2_gistfile1.ps1
#!/bin/bash # # Start CouchBase Server 2.2 ## [ "$HOME" != "" ] && exec -c $0 export SHLVL=1 export HOME=/Users/dominik export COUCHDB_ADDITIONAL_CONFIG_FILE=/Users/dominik/Library/Preferences/couchbase-server.in cd "/Applications/Couchbase Server.app/Contents/Resources" ./start-server.sh
PowerShellCorpus/GithubGist/gunungloli666_5716746_raw_ad3c53cd521927597c7640805851138b0f0d3df9_sph.ps1
gunungloli666_5716746_raw_ad3c53cd521927597c7640805851138b0f0d3df9_sph.ps1
# untuk mencari perintah tertentu pada isi suatu file program # dan mencari tahu pada baris mana perintah tersebut berada $a = dir ;# directory saat ini # string yang akan dicari, dalam hal ini perintah tertentu pada fortran $my_regex = [regex] "In+\spoute_2D" # iterasi untuk seluruh isi directory saat ini f...
PowerShellCorpus/GithubGist/vgrem_7550721_raw_76cfc8ee80f7395dd22abdb3471e916a5dc929d2_PrintWebProperties.ps1
vgrem_7550721_raw_76cfc8ee80f7395dd22abdb3471e916a5dc929d2_PrintWebProperties.ps1
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.SharePoint.Client.dll' Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.SharePoint.Client.Runtime.dll' function PrintWebProperties() { param( [...
PowerShellCorpus/GithubGist/GuruAnt_9185054_raw_e16c69c012905758182a327693755f648b286ac0_RemoveAppSenseCCAGUID.ps1
GuruAnt_9185054_raw_e16c69c012905758182a327693755f648b286ac0_RemoveAppSenseCCAGUID.ps1
# Remove AppSense CCA GUID # "Removing values" If (Get-ItemProperty -Path "HKLM:\Software\AppSense Technologies\Communications Agent" -name "machine id" -ErrorAction SilentlyContinue){ Remove-ItemProperty -Path "HKLM:\Software\AppSense Technologies\Communications Agent" -name "machine id" } If (Remove-ItemProperty...
PowerShellCorpus/GithubGist/rlaneve_1ed4ec2cdd5cbcd585db_raw_598b1f9b28a49e156a0329d1d8b0b3303fc9df34_boxstarter.ps1
rlaneve_1ed4ec2cdd5cbcd585db_raw_598b1f9b28a49e156a0329d1d8b0b3303fc9df34_boxstarter.ps1
# Run in IE: http://boxstarter.org/package/nr/url?https://URL_TO_THIS_GISTS_RAW_CONTENT Disable-UAC Update-ExecutionPolicy Unrestricted Set-StartScreenOptions -EnableBootToDesktop -EnableShowStartOnActiveScreen -EnableSearchEverywhereInAppsView -EnableListDesktopAppsFirst Set-CornerNavigationOptions -DisableUpperRi...
PowerShellCorpus/GithubGist/blachniet_6063622_raw_696c3320946b2f1dca3b7ed4567238b38d6f13ef_PowerShellQuickies.ps1
blachniet_6063622_raw_696c3320946b2f1dca3b7ed4567238b38d6f13ef_PowerShellQuickies.ps1
################################################################################ # Run Files Last Accessed After Date Get-ChildItem C:\Input | Select-Object FullName, LastAccessTime | Where-Object {$_.LastAccessTime -g "01/01/2013"} %{.\SuperAwesomize.exe $_.FullName} ###################################...
PowerShellCorpus/GithubGist/mattpodwysocki_1300037_raw_c88d12c50e764f493d3b1e51cc80c6d8d859fafe_download-entries.ps1
mattpodwysocki_1300037_raw_c88d12c50e764f493d3b1e51cc80c6d8d859fafe_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 = 500 #use $top = $null to grab all $destinationDirectory = join-path "C:\\Dev" "LocalNuGet" # --- locals --- $webClient = New-Object Sy...
PowerShellCorpus/GithubGist/andrewheiss_311147_raw_744446f538da63a351545cb4f32236ac06cdb545_Download%20Quran.ps1
andrewheiss_311147_raw_744446f538da63a351545cb4f32236ac06cdb545_Download%20Quran.ps1
# PowerShell Qur'an Downloader # # Author: Andrew Heiss - http://www.andrewheiss.com # Project site: http://gist.github.com/311147 # Description: Uses Windows PowerShell to download the Qur'an # License: Licensed under the MIT License (see below) # Date: February 22, 2010 # Version: 1.0 (February 22, 2010) # # #...
PowerShellCorpus/GithubGist/PhilMarcuson_7ec4f1a3c0318c1fc574_raw_963b2269589f167fc77d30d88b69f6d73003e0d4_Office365PowerShellConnectionScripts.ps1
PhilMarcuson_7ec4f1a3c0318c1fc574_raw_963b2269589f167fc77d30d88b69f6d73003e0d4_Office365PowerShellConnectionScripts.ps1
# You must be running Windows PowerShell as an Administrator # Configure PowerShell to run scripts # -- http://technet.microsoft.com/en-us/library/hh849812.aspx # -- Note: You'll need registry edit access on the local machine to run the following command Set-ExecutionPolicy RemoteSigned # Pull in the Offi...
PowerShellCorpus/GithubGist/peaeater_d6ab025d108308d4733e_raw_d1c0d296b348081ef8cca98b494a4b8a648212b3_push-dir-to-remote.ps1
peaeater_d6ab025d108308d4733e_raw_d1c0d296b348081ef8cca98b494a4b8a648212b3_push-dir-to-remote.ps1
<# Sync a directory to remote server via WinSCP in SFTP mode. - Uses SFTP instead of SCP to deny any shell commands to the user, just file transfer. - Use a chrooted user on remote server (user jailed to their root dir). - Writes to Application Event Log; log source must already have been added ...
PowerShellCorpus/GithubGist/smasterson_9136468_raw_2c171d161212d3ffe364a7ab2111c99072f4073b_MyVeeamReport.ps1
smasterson_9136468_raw_2c171d161212d3ffe364a7ab2111c99072f4073b_MyVeeamReport.ps1
asnp "VeeamPSSnapIn" -ErrorAction SilentlyContinue #region User-Variables # Report Title $rptTitle = "My Veeam Report" # Report mode - valid modes: any number of hours, Weekly or Monthly # 24, 48, "Weekly", "Monthly" $reportMode = 24 # Save output to a file - $true or $false $saveFile = $true # File output ...
PowerShellCorpus/GithubGist/Romoku_4004076_raw_cdca9bcd28d549f43cbdb16be837af3beed0ef42_logger.ps1
Romoku_4004076_raw_cdca9bcd28d549f43cbdb16be837af3beed0ef42_logger.ps1
param( [String]$filePath="", [String]$fileName="" ) $logFile = "C:\temp\log.txt" Function Log($fileName, $filePath) { $currentDate = Get-Date Add-Content $logFile "File Name: ${fileName} FileP Path: ${filePath}" } Log $fileName $filePath
PowerShellCorpus/GithubGist/sandrinodimattia_3645633_raw_9184bebb1caebb32d59a748d155f0e0f6c40dcfa_gistfile1.ps1
sandrinodimattia_3645633_raw_9184bebb1caebb32d59a748d155f0e0f6c40dcfa_gistfile1.ps1
param([string]$ConnectionString = $(throw "The ConnectionString parameter is required."), [string]$DatabaseName = $(throw "The DatabaseName parameter is required."), [string]$InputFile = $(throw "The InputFile parameter is required."), [string]$SqlInstallationFolder = "C:\Program Files (x86)\Micr...
PowerShellCorpus/GithubGist/JonBons_1751dba197252039cb5a_raw_c004ebf438c2839cb29b4dd6beb5f9eb300a305a_gistfile1.ps1
JonBons_1751dba197252039cb5a_raw_c004ebf438c2839cb29b4dd6beb5f9eb300a305a_gistfile1.ps1
hg log -r "descendants(4b70a250592c) and head()" --template "{branch}\n" | Sort-Object -Unique > merge.txt
PowerShellCorpus/GithubGist/40a_7392178_raw_613b0b5ed711b9f32f6463dd172f12bf7ef98704_SetPullMode-RTM.ps1
40a_7392178_raw_613b0b5ed711b9f32f6463dd172f12bf7ef98704_SetPullMode-RTM.ps1
Configuration SetPullMode { Node Server01 { # Set the DSC engine (LCM) to Pull mode LocalConfigurationManager { ConfigurationID = "e528dee8-6f0b-4885-98a1-1ee4d8e86d82" ConfigurationMode = "ApplyOnly" RefreshMode ...
PowerShellCorpus/GithubGist/belotn_5957878_raw_0ddaf988a031310e237e3f9035485896c89c0206_onescan_fillsqllite.ps1
belotn_5957878_raw_0ddaf988a031310e237e3f9035485896c89c0206_onescan_fillsqllite.ps1
get-eventlog -LogName "Key Management Service" -ComputerName "COMPNAME" -InstanceId 1073754114 | select Index,Message |% {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] -Passthru | Add-Mem...
PowerShellCorpus/GithubGist/janikvonrotz_6883313_raw_a376f4d6707e0418e43161e46a3e550860aa4790_Get-UnlinkedGPO.ps1
janikvonrotz_6883313_raw_a376f4d6707e0418e43161e46a3e550860aa4790_Get-UnlinkedGPO.ps1
function Get-UnlinkedGPO { <# .SYNOPSIS Get all unlinkend GPOs .EXAMPLE PS C:\> Get-UnlinkedGPO #> $Metadata = @{ Title = "Get unlinked GPOs" Filename = "Get-UnlinkedGPO.ps1" Description = "" Tags = "powershell, function, activedirectory" Project = "" Author = "Janik von Rotz" AuthorContac...
PowerShellCorpus/GithubGist/zhujo01_059a82107a13e76c14cd_raw_86a05da24bf3f7bf27b6907015d77201358f2a26_aws-test.ps1
zhujo01_059a82107a13e76c14cd_raw_86a05da24bf3f7bf27b6907015d77201358f2a26_aws-test.ps1
######################################################################## # AWS EC2 Windows Bootstrapping Script # Supported OS: # - Windows 2008 Server R2 SP1 (TESTED) # - Windows 2008 Server (TO BE TESTED) # - Windows 2012 Server (TO BE TESTED) # Image Transformation Target Cloud # - VMWare vSph...
PowerShellCorpus/GithubGist/ziqbalbh_d37cc8a36a18fa696a6b_raw_e56653ec2b88d68ed80126d9fc6ad4632be1cbe9_gac-install.ps1
ziqbalbh_d37cc8a36a18fa696a6b_raw_e56653ec2b88d68ed80126d9fc6ad4632be1cbe9_gac-install.ps1
param($assembly) if ($assembly -eq $null) { write-host -foregroundcolor red "-assembly parameter is required." return } try { [Reflection.Assembly]::LoadWithPartialName("System.EnterpriseServices") | Out-Null [System.EnterpriseServices.Internal.Publish] $publish = New-Object System.EnterpriseServices.I...
PowerShellCorpus/GithubGist/ashes999_56f358624dd498d34e4a_raw_5a3d0ce65b914ed63f399187fb0073b84b2b3504_boxstarter-pc.ps1
ashes999_56f358624dd498d34e4a_raw_5a3d0ce65b914ed63f399187fb0073b84b2b3504_boxstarter-pc.ps1
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar Enable-RemoteDesktop $packages = @( 'fiddler4', 'conemu', 'dropbox', 'virtualbox', 'VirtualBox.ExtensionPack', 'VBoxHeadlessTray', 'GoogleChrome' ) foreach ($package in $...
PowerShellCorpus/GithubGist/peaeater_32d339acb7cd3eec1e3e_raw_5d056b83822a3a0c9582cd4412ebe6ee734c3e8b_extractomatic.ps1
peaeater_32d339acb7cd3eec1e3e_raw_5d056b83822a3a0c9582cd4412ebe6ee734c3e8b_extractomatic.ps1
<# Extracts data from the named textbase as files like {tn}-{0}.xml in output folder. Logs to Application event log - source must already have been added. #> param( [Parameter(Mandatory=$false,Position=0)] [string]$logsrc = "Andi Solr Update" ) $basePath = "c:\path\to\extract-exe" $textbase...
PowerShellCorpus/GithubGist/vermiceli_108fec65759d19645ee3_raw_bb241ba8ba864a5cb8cd346265704c5900805b57_build_ui.ps1
vermiceli_108fec65759d19645ee3_raw_bb241ba8ba864a5cb8cd346265704c5900805b57_build_ui.ps1
# This is a powershell commandlet equivalent of build_ui.sh for installation on Windows # Generate python files based on the designer ui files. pyrcc4 should be on the path. # If you need to modify the python location or pyuic path, just change the 2 variables below $pythonPath = "C:\Python27\" $pyuicPath = "C:\...
PowerShellCorpus/GithubGist/jstangroome_1172293_raw_209a411b8633484dbb6abd6e2ff4011bd20438b3_q1.ps1
jstangroome_1172293_raw_209a411b8633484dbb6abd6e2ff4011bd20438b3_q1.ps1
$Result = Get-ChildItem -Path $Env:TEMP
PowerShellCorpus/GithubGist/dfinke_7678410_raw_844816319537f63cbd1f0314315d560712b51ee8_CountryLoopup.ps1
dfinke_7678410_raw_844816319537f63cbd1f0314315d560712b51ee8_CountryLoopup.ps1
$CountryLookup = [ordered]@{ "AD"="ANDORRA" "AE"="UNITED ARAB EMIRATES" "AF"="AFGHANISTAN" "AG"="ANTIGUA AND BARBUDA" "AI"="ANGUILLA" "AL"="ALBANIA" "AM"="ARMENIA" "AO"="ANGOLA" "AQ"="ANTARCTICA" "AR"="ARGENTINA" "AS"="AMERICAN SAMOA" "AT"="AUSTRIA" "AU"=...
PowerShellCorpus/GithubGist/jonforums_564589_raw_9ab5dac3d70223e94916a40fdf8ca4804ceb74cb_devkitvars.ps1
jonforums_564589_raw_9ab5dac3d70223e94916a40fdf8ca4804ceb74cb_devkitvars.ps1
# convenience script residing in the DevKit root dir used for # manually configuring a PowerShell environment to use the # DevKit for compiling native Ruby extensions echo "Adding DevKit to PATH..." $devkit = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Definition) $env:path = "$devkit\bin;$devkit\mi...
PowerShellCorpus/GithubGist/jlao_3507824_raw_fb889d9ba0b353e298eddec2653edfa724f34f4a_profile.ps1
jlao_3507824_raw_fb889d9ba0b353e298eddec2653edfa724f34f4a_profile.ps1
function prompt { $loc = Get-Location $parts = $loc.Path.split("\") $shortparts = @($parts[0]) if ($parts.length -gt 2) { $shortparts += $parts[1..($parts.length - 2)] | % { $_[0] } } $shortparts += $parts[-1] $locstr = [string]::join("\", $shortparts) ...
PowerShellCorpus/GithubGist/belotn_5984505_raw_217f0c86a72058e43e82e81ac7d623d4b106d4de_onescan_csv_incremental.ps1
belotn_5984505_raw_217f0c86a72058e43e82e81ac7d623d4b106d4de_onescan_csv_incremental.ps1
get-eventlog -LogName "Key Management Service" -ComputerName "COMPUTER" -InstanceId 1073754114 -After $([datetime]::ParseExact( $(import-csv .\Leases.csv |? { $_.ServerName -eq "COMPUTER" }| select TimeGenerated | sort TimeGenerated -desc | select -First 1).TimeGenerated ,'MM/dd/yyyy HH:mm:ss', $null) ) | select Index...
PowerShellCorpus/GithubGist/stuncloud_d7dcf3c5174250e542c7_raw_2981cbfde9170cf48099b29137623913b0e5ea4c_Get-FirstLogonTime.ps1
stuncloud_d7dcf3c5174250e542c7_raw_2981cbfde9170cf48099b29137623913b0e5ea4c_Get-FirstLogonTime.ps1
function Get-FirstLogonTime { [CmdletBinding()] param( [parameter(Mandatory=$false,Position=0,ValueFromPipelineByPropertyName)] [DateTime[]] $Date = $(Get-Date) ) begin { if (-not $IsAdmin) { Write-Error '管理者特権で実行してください' break } ...
PowerShellCorpus/GithubGist/seraphy_8293523_raw_b93f5f68910cae59cc0456027e6bb9504e78ef1b_MeasureLineCounter.ps1
seraphy_8293523_raw_b93f5f68910cae59cc0456027e6bb9504e78ef1b_MeasureLineCounter.ps1
# 第一引数として、対象となるファイルまたは親ディレクトリを指定する. # 省略時はカレントディレクトリ以下のすべてのファイルを対象とする. param($searchPath = $(pwd)) # 指定したフォルダ以下の全てのファイルを取得する. # (ファイルが指定された場合はファイル自身を返す) function GetFilesRecurse([string] $path) { Get-ChildItem $path -Recurse | Where-Object -FilterScript { # ディレクトリ以外のみ (ディレクトリのビットマスク値...
PowerShellCorpus/GithubGist/mckn_4136080_raw_9d7db252e302d45a4f69b07ed7a139933043bad6_semver.ps1
mckn_4136080_raw_9d7db252e302d45a4f69b07ed7a139933043bad6_semver.ps1
function Bump-Version { param([string]$part = $(throw "Part is a required parameter.")) $version = Get-AssemblyInfoVersion -Directory ..\Source -GlobalAssemblyInfo $true $bumpedVersion = Clone-Object -Object $version switch -wildcard ($part) { "ma*" { $bumpedVersion.Major = Bump-NumericVersion -Curren...
PowerShellCorpus/GithubGist/headchant_6240555_raw_5269823d01de1f81dce3d124385d1db03aa79ef5_roguelike.ps1
headchant_6240555_raw_5269823d01de1f81dce3d124385d1db03aa79ef5_roguelike.ps1
Function writetext { Param ([int]$x, [int]$y, [string]$text) [Console]::SetCursorPosition($x, $y) [Console]::Write($text) } # set background color of the shell to black (Get-Host).UI.RawUI.BackgroundColor = "black" clear # player objects factory function function newPlayer() { $player = New-Obje...
PowerShellCorpus/GithubGist/pnowosie_6160177_raw_acd2d773990397edce52a365a8073e9b7dc0888b_SimpleAutoVersion.ps1
pnowosie_6160177_raw_acd2d773990397edce52a365a8073e9b7dc0888b_SimpleAutoVersion.ps1
## TODO: Add header, licence ... # Missing parts: # * Error handlig # * User friendly configuration and customization # * Usage info # ===== Configuration ==== # $SVNCMD = "C:\Program Files\TortoiseSVN\bin\svn.exe" $BUILDTOOL = "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" # What i...
PowerShellCorpus/GithubGist/n3wjack_4b370eeb47dcbd90e010_raw_871422222766009294faf220c444d91d6c89b169_recycle.ps1
n3wjack_4b370eeb47dcbd90e010_raw_871422222766009294faf220c444d91d6c89b169_recycle.ps1
# Recycle application pools based on a given substring using the appcmd.exe tool. param ( $AppPool ) $appcmd = "C:\Windows\system32\inetsrv\appcmd.exe" $pools = & $appcmd list apppool | % { ($_ -split "`"")[1] } foreach ($pool in ($pools -like "*$AppPool*")) { & $appcmd recycle apppool $pool }...
PowerShellCorpus/GithubGist/jrotello_3095372_raw_d5b027e6821c99efeb267a1b596c7b715e9c2c6e_GodMode.ps1
jrotello_3095372_raw_d5b027e6821c99efeb267a1b596c7b715e9c2c6e_GodMode.ps1
$godMode = "$env:userprofile\Desktop\GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}" if (!(Test-Path -Path $godMode)) { mkdir $godMode }
PowerShellCorpus/GithubGist/smasterson_9141359_raw_374d9ff698d283378bb0f16e2f97a1ba748ffff7_DeployVM.ps1
smasterson_9141359_raw_374d9ff698d283378bb0f16e2f97a1ba748ffff7_DeployVM.ps1
<# .SYNOPSIS Deploy Multiple VMs to vCenter .DESCRIPTION VMs are deployed asynchronously based on a pre-configured csv file (DeployVM.csv) .PARAMETER csvfile Path to DeployVM.csv file with new VM info .PARAMETER vCenter vCenter Server FQDN or IP .PARAMETER auto Will allow script to run with no review...
PowerShellCorpus/GithubGist/MikeAStevenson_a018025b0f12404d3d0e_raw_77e3bab52d923b041722c141bc316d8852b02d51_Get-LockedOutUsers.ps1
MikeAStevenson_a018025b0f12404d3d0e_raw_77e3bab52d923b041722c141bc316d8852b02d51_Get-LockedOutUsers.ps1
# # Date : 2014-10-31 M. Stevenson - Initial Version # Desc : Get users that were probably locked out by a # bad password # Get-ADUser -Filter { LockoutTime -gt 0 -and BadPwdCount -ge 5 } -Properties * | sort lockouttime -descending | ForEach-Object { $lockouttime = [DateTime]::FromFileTimeUtc($_.lo...
PowerShellCorpus/GithubGist/jelster_e1cc34e3303dacaad36f_raw_075cda9d0c4c9e2a3ccee68b9ec06d856356e163_mech-importer.ps1
jelster_e1cc34e3303dacaad36f_raw_075cda9d0c4c9e2a3ccee68b9ec06d856356e163_mech-importer.ps1
Function Get-MwoBlenderMech { [CmdletBinding()] param( [Parameter(Position = 0, Mandatory = $True, ValueFromPipeline=$true)] [Alias('Family')] [Alias('Chassis')] [string[]]$MechFamily, [Parameter(Position=1, Mandatory=$false, valuefrompipeline=$false)] [Alias('Path')] ...
PowerShellCorpus/GithubGist/adamskt_2891859_raw_5525efd457073af0117df0c9f05278c8f8ee3e12_GetLatestTfsDropLocation.ps1
adamskt_2891859_raw_5525efd457073af0117df0c9f05278c8f8ee3e12_GetLatestTfsDropLocation.ps1
Add-Type -AssemblyName "Microsoft.TeamFoundation.Client, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" Add-Type -AssemblyName "Microsoft.TeamFoundation.Build.Client, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" $tfsUri ...
PowerShellCorpus/GithubGist/stevegood_733292_raw_c5ecc6725ae5d6d8ef3470b64f212197de6ebac6_Microsoft.PowerShell_profile.ps1
stevegood_733292_raw_c5ecc6725ae5d6d8ef3470b64f212197de6ebac6_Microsoft.PowerShell_profile.ps1
new-alias jrun "C:\ColdFusion9\runtime\bin\jrun.exe" function cf($server="coldfusion"){ jrun -start $server }
PowerShellCorpus/GithubGist/JFFail_48e7961082636c6747d5_raw_72dccdb939f76a62cdf9b375a0b91ced83ac3380_deparse-numbers.ps1
JFFail_48e7961082636c6747d5_raw_72dccdb939f76a62cdf9b375a0b91ced83ac3380_deparse-numbers.ps1
<# # Reddit Daily Programmer 199 Part 2 # http://www.reddit.com/r/dailyprogrammer/comments/2u0fyx/2015126_challenge_199_bank_number_banners_pt_2/ #> #Create the strings for the inputs. $inputTop = " _ _ _ _ _ _ _ " $inputMid = "|_| |_| | | |_| |_ | | | |_ " $inputBot = " | _|...
PowerShellCorpus/GithubGist/mikeplate_3789958_raw_a6d8aacada95cb55ddca20046ebdb3655caf6ab4_sp-create-users.ps1
mikeplate_3789958_raw_a6d8aacada95cb55ddca20046ebdb3655caf6ab4_sp-create-users.ps1
$user_list = "SPS_INSTALL", "SQL_SERVICE", "SPS_FARM", "SPS_APP_POOL1", "SPS_MYSITE", "SPS_SERVICES", "SPS_SEARCH", "SPS_CRAWL", "SPS_PROFILE", "SPS_CACHEADM", "SPS_CACHERD" function Gen-Password([int]$length) { $assembly = Add-Type -AssemblyName System.Web [System.Web.Security.Membership]::GeneratePasswor...
PowerShellCorpus/GithubGist/palmar_61bc83fff37b5c539577_raw_11614f5495670d7093ce51c295a91918339041f3_gistfile1.ps1
palmar_61bc83fff37b5c539577_raw_11614f5495670d7093ce51c295a91918339041f3_gistfile1.ps1
Write-Output "Do you want to play as Russia or USA?" $select = $false $dead = $false While($select -eq $false) { $a = Read-Host if($a -eq "Russia") { Write-Output "Greetings comrade" Write-Output " " $select = $true $opp = "USA" } elseif($a -eq "USA...
PowerShellCorpus/GithubGist/jbarber_464358_raw_b45f8b7ec2f3a48aa68e7cd44c0e8bf5f27ee86f_deballoon.ps1
jbarber_464358_raw_b45f8b7ec2f3a48aa68e7cd44c0e8bf5f27ee86f_deballoon.ps1
# VMware: set the advanced configuration option sched.mem.maxmemctl to zero to prevent ballooning function deballoon ($vmname) { # Set "sched.mem.maxmemctl" to 0 $opt = new-object Vmware.Vim.OptionValue -Property @{ Key = "sched.mem.maxmemctl"; Value = 0 } $vmConfigSpec = New-Object VMware.Vim.VirtualMachineC...
PowerShellCorpus/GithubGist/seanbamforth_9388507_raw_55c4b36df66b6bac7dd809d0029553073969ac93_AmazonEtagHashForFile.ps1
seanbamforth_9388507_raw_55c4b36df66b6bac7dd809d0029553073969ac93_AmazonEtagHashForFile.ps1
#Calculates an eTag for a local file that should match the S3 eTag of the uploaded file. $md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider $blocksize = (1024*1024*5) $startblocks = (1024*1024*16) function AmazonEtagHashForFile($filename) { $lines = 0 [byte[]] $binHas...
PowerShellCorpus/GithubGist/gpduck_6308785_raw_e4774a06530f5bd6fa7c63a03c3d81e38cb27846_Get-HexValue.ps1
gpduck_6308785_raw_e4774a06530f5bd6fa7c63a03c3d81e38cb27846_Get-HexValue.ps1
function Get-HexValue { param( [Parameter(Mandatory=$true)] [Char]$Character, [ValidateSet("ASCII","BigEndianUnicode","Default","Unicode","UTF32","UTF7","UTF8")] [String]$Encoding = "Unicode" ) $E = [Text.Encoding]::$Encoding $Bytes = $E.GetBytes($Character) if($Encoding -ne "BigEndianUnicode"...
PowerShellCorpus/GithubGist/johndacosta_6081808_raw_00aa982a3f7642d3c408de3e34ae03e4794f174c_Get-SQLServerDatabaseUsers.ps1
johndacosta_6081808_raw_00aa982a3f7642d3c408de3e34ae03e4794f174c_Get-SQLServerDatabaseUsers.ps1
## Invoke by Running .\Get-SQLServerDatabaseUsers.ps1 SQLSERVER\INSTANCENAME ## Gets List of Applications, Users and Host Names from SQL Server Default Trace param( [string] $ServerInstance = $(Throw "Provide a SQL Server Instance Name as first parameter") ) [void][System.Reflection.Assembly]::LoadWithPartialNa...
PowerShellCorpus/GithubGist/mkropat_0aa2b45503bcc9fc4b6f_raw_6f8dba73e4dbb5b1ca50ec03dd9f38e8c42fe38c_provision-base-box.ps1
mkropat_0aa2b45503bcc9fc4b6f_raw_6f8dba73e4dbb5b1ca50ec03dd9f38e8c42fe38c_provision-base-box.ps1
# provision-base-box.ps1 - Prepare Server 2012 for building a Vagrant base box # Instructions: # # 1. Create a new Windows VM in VirtualBox # 2. Install Server 2012 R2 onto the VM # 3. Download and run this script from within the VM # 4. Install Windows Updates within the VM # 5. From the host machine, run: `v...
PowerShellCorpus/GithubGist/gravejester_474bb7f65062d8de168c_raw_943ff8363642427e3a3ac60d93ecc8ce4102d090_Get-VMWareResourceStatus.ps1
gravejester_474bb7f65062d8de168c_raw_943ff8363642427e3a3ac60d93ecc8ce4102d090_Get-VMWareResourceStatus.ps1
function Get-VMWareResourceStatus { <# .SYNOPSIS Get resource status from VMWare vSphere .DESCRIPTION Get overall status, configuration status and any configuration issues on VMWare resources by querying vSphere. .EXAMPLE Get-VMWareResourceStatus -VIServer 'VIServer01' -ResourceType 'VirtualM...
PowerShellCorpus/GithubGist/erik-kallen_3437689_raw_2c839e276282ecd679cac84c5db109fe2d811d68_GenerateSqlClrAssemblySql.ps1
erik-kallen_3437689_raw_2c839e276282ecd679cac84c5db109fe2d811d68_GenerateSqlClrAssemblySql.ps1
Param( [Parameter(Mandatory=$true)][string] $File, [string]$Schema = "dbo", [string]$PermissionSet = "safe" ) Function Parse-Attr($attr) { if ($attr) { $result = @{ "TypeName" = $attr.AttributeType.Name } $attr.Properties | % { $result[$_.Name] = $_.Argument.Value } $result } else { $null ...
PowerShellCorpus/GithubGist/phwelo_b629d76ac175ad1e0497_raw_653a9cfb73e6028fb2bc54e0ba14f7e10cd2cc06_gistfile1.ps1
phwelo_b629d76ac175ad1e0497_raw_653a9cfb73e6028fb2bc54e0ba14f7e10cd2cc06_gistfile1.ps1
Get-Federationtrust | Set-FederationTrust –RefreshMetadata
PowerShellCorpus/GithubGist/yzorg_88d041f0e69f45a967b2_raw_d5238641c56f7e318d30c9b6952834a4b9c86fed_CreateHardLinks.ps1
yzorg_88d041f0e69f45a967b2_raw_d5238641c56f7e318d30c9b6952834a4b9c86fed_CreateHardLinks.ps1
#CreateHardLinks -source C:\folderD -destination c:\folderC -recurse function CreateHardLinks ($Source, $Destination, [switch]$Recurse) { # Copy of directory structure best handled with `robocopy /E /XF *`, # which will copy directory timestamps. if ($recurse) { robocopy $Source $Destinati...
PowerShellCorpus/GithubGist/vongillern_5404915_raw_d1738a00c63a075559a29ed00b555d7cd7ce36cf_gistfile1.ps1
vongillern_5404915_raw_d1738a00c63a075559a29ed00b555d7cd7ce36cf_gistfile1.ps1
#profile.example.ps1 Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent) # Load posh-git module from current directory Import-Module .\posh-git # If module is installed in a default location ($env:PSModulePath), # use this instead (see about_Modules for more information): # Import-Mo...
PowerShellCorpus/GithubGist/aggieben_227582_raw_3d3d8c926607e4230ffc330132a67bc9fbc829d5_Enable-SPAjax.ps1
aggieben_227582_raw_3d3d8c926607e4230ffc330132a67bc9fbc829d5_Enable-SPAjax.ps1
# script for AJAX-enabling a SharePoint (MOSS 2007 / WSS 3.0) config # Copyright © 2009 Benjamin Collins <ben.collins@acm.org> # # Compatible with .NET 3.5 AJAX support and AJAX Control Toolkit # # usage: # enable-spajax <path to web.config> # function usage { write-host "Enable-SpAjax <path>" write-host "Cop...
PowerShellCorpus/GithubGist/robertchong_e2c64ddae8c3369bd289_raw_8f455e4721bfa66518bbc5e81d47f12c40eb0811_Get-LoggedOnUsers.ps1
robertchong_e2c64ddae8c3369bd289_raw_8f455e4721bfa66518bbc5e81d47f12c40eb0811_Get-LoggedOnUsers.ps1
<# .Synopsis This script will use the Sysinternals PsLoggedon.exe tool to get the list of users logged onto a workstation or computer .Description The script has a check built in to validate that the computer name belongs to your domain. It will also get the full name of the logged on us...
PowerShellCorpus/GithubGist/ao-zkn_114e0175345cb899395f_raw_f594dda3cd9e5725dc99f64b336cf1abaf624429_Out-LogFile.ps1
ao-zkn_114e0175345cb899395f_raw_f594dda3cd9e5725dc99f64b336cf1abaf624429_Out-LogFile.ps1
# ------------------------------------------------------------------ # ログをファイルに出力する # 関数名:Out-LogFile # 引数 :LogFilePath ログファイルパス # :Value ログとして出力する文字列 # :LogType ログの種類(0:デバック,1:情報,2:警告,3:エラー) # 指定がない場合は「情報」として出力 # :Encoding 文字コード # 指定がない場合は「UTF8」として出力 # 戻り値:なし # ---------------------...
PowerShellCorpus/GithubGist/michaelherndon_eaf19bf88e8388ef757e_raw_96ab043d2716efc346f7b98ac6913a00ba373905_examples.ps1
michaelherndon_eaf19bf88e8388ef757e_raw_96ab043d2716efc346f7b98ac6913a00ba373905_examples.ps1
<# Copyright 2014 Michael Herndon Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing,...
PowerShellCorpus/GithubGist/anderssonjohan_b612f0fe036e75fe76d3_raw_e6d339e5a6805f4046311550fe04387560253bba_generate-createscript.ps1
anderssonjohan_b612f0fe036e75fe76d3_raw_e6d339e5a6805f4046311550fe04387560253bba_generate-createscript.ps1
param( [parameter(mandatory=$false)] $sqlInstance = "(local)", [parameter(mandatory=$false)] $database, [switch] $silent ) $csFilePath = join-path -resolve $PSScriptRoot "Services/RESTService/Service/connectionstrings.config" $CreateTablesSql = join-path -resolve $PSScriptRoot "Setup/SetupSkeleton/DB/S...
PowerShellCorpus/GithubGist/kyle-herzog_4053002_raw_2118775f7b633f928c656cd7881feaaf0e2c8092_Expand-Item7Zip.ps1
kyle-herzog_4053002_raw_2118775f7b633f928c656cd7881feaaf0e2c8092_Expand-Item7Zip.ps1
function Expand-Item7zip { param ( [Parameter(Mandatory=$true)] [string] $item, [Parameter(Mandatory=$true)] [string] $destinationDirectory ) if (!(Test-Path -Path $item -PathType Leaf)) { throw ("Specified archive File is invalid: " + $item) } if (!(Test-Path -Path $destination...
PowerShellCorpus/GithubGist/ajkerrigan_5ca7a8bb5460c7789e37_raw_86c5cfd943d3dc32eb4e831b83f19ce7cb7e7ae8_Set-LoLCompatMode.ps1
ajkerrigan_5ca7a8bb5460c7789e37_raw_86c5cfd943d3dc32eb4e831b83f19ce7cb7e7ae8_Set-LoLCompatMode.ps1
function Set-LoLCompatibilityMode { param( $InstallPath = 'C:\Riot Games' ) # This Powershell function automates some settings changes I've seen recommended # for Windows 8.1 users experiencing League of Legends lag spikes on Windows 8.1. # # Warnings: # - This is a quick script in...
PowerShellCorpus/GithubGist/ofonesandzeros_e2fe42d89a0a68c32b56_raw_4c32442f96b3182600eb6e249aecf2cacf09411c_Get-Fab40.ps1
ofonesandzeros_e2fe42d89a0a68c32b56_raw_4c32442f96b3182600eb6e249aecf2cacf09411c_Get-Fab40.ps1
<# .SYNOPSIS Get-Fab40 .DESCRIPTION Get a list of the webs and the templates from which they were built within a specified web application. I wrote this script to determine which sites were based on the "Fabulous 40" site templates for SharePoint 2007 after upgrading my client to SharePoint 2010. .EXA...
PowerShellCorpus/GithubGist/devlead_9146bf4aec78c7b1114e_raw_e94d4da7bb8d4470c1a493573608b505209ee3cb_PostMessage.ps1
devlead_9146bf4aec78c7b1114e_raw_e94d4da7bb8d4470c1a493573608b505209ee3cb_PostMessage.ps1
$postSlackMessage = @{token="*topsecret*";channel="#general";text="Hello from PowerShell!";username="PowerShell";icon_url="https://pbs.twimg.com/profile_images/1604347359/logo_512x512_normal.png"} Invoke-RestMethod -Uri https://slack.com/api/chat.postMessage -Body $postSlackMessage
PowerShellCorpus/GithubGist/codingoutloud_4253147_raw_528b7ded8150625c85044d04332b8842344ae5b5_temp-tidy.ps1
codingoutloud_4253147_raw_528b7ded8150625c85044d04332b8842344ae5b5_temp-tidy.ps1
# The intent is that the command is to be scheduled to be run by the Windows Scheduler once a day: http://stackoverflow.com/a/8888886 # For Windows Azure, a new Windows Scheduler task is best added by a Startup Script and, like any other machine with the default PowerShell security settings, will need the PowerShell E...
PowerShellCorpus/GithubGist/heaths_8722508_raw_acb91a8c28c90576dca28589d31b57684501d93c_Move-WixPackageCache.ps1
heaths_8722508_raw_acb91a8c28c90576dca28589d31b57684501d93c_Move-WixPackageCache.ps1
<# This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software. 1. Definitions The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright...
PowerShellCorpus/GithubGist/jongalloway_1402840_raw_7eda51c29f41522ab575e89436bc325a7c4a48da_GetLocalNuget.ps1
jongalloway_1402840_raw_7eda51c29f41522ab575e89436bc325a7c4a48da_GetLocalNuget.ps1
# --- settings --- $feedUrlBase = "http://go.microsoft.com/fwlink/?LinkID=206669" # the rest will be params when converting to funclet $latest = $true $overwrite = $false $top = 500 #use $top = $null to grab all $destinationDirectory = join-path ([Environment]::GetFolderPath("MyDocuments")) "NuGetLocal" # --- ...
PowerShellCorpus/GithubGist/mbrownnycnyc_48a88ac982e9e09ff2c9_raw_2249c30bea59143ae05b95aa6ae710fcc92c027d_get-aduserbysid.ps1
mbrownnycnyc_48a88ac982e9e09ff2c9_raw_2249c30bea59143ae05b95aa6ae710fcc92c027d_get-aduserbysid.ps1
function get-aduserbysid{ #http://community.spiceworks.com/how_to/show/2776-powershell-sid-to-user-and-user-to-sid param( [string]$domain, [string]$sid ) $objSID = New-Object System.Security.Principal.SecurityIdentifier ` ("$sid") $objUser = $objSID.Translate( [System.Security.Principal.NTAccount]) $objU...
PowerShellCorpus/GithubGist/uncas_1988101_raw_0c57051419aa7bc6f4203368621a6451c96eb1c6_NuGetCopy.ps1
uncas_1988101_raw_0c57051419aa7bc6f4203368621a6451c96eb1c6_NuGetCopy.ps1
# Input: $inputFolder = "D:\Projects" $destinationFolder = "D:\LocalNuGetFeed\" if (!(Test-Path $destinationFolder)) { mkdir $destinationFolder } $files = gci $inputFolder -recurse $packages = $files | where {$_.extension -eq ".nupkg"} foreach ($package in $packages) { $packageName = $package.Name ...
PowerShellCorpus/GithubGist/jonforums_5095788_raw_3e6b6a826a7645baa83a30d7a2e1bb141750d28b_build_zlib.ps1
jonforums_5095788_raw_3e6b6a826a7645baa83a30d7a2e1bb141750d28b_build_zlib.ps1
#requires -version 2.0 # Author: Jon Maken # License: 3-clause BSD # Revision: 2013-03-11 01:39:59 -0600 # # TODO: # - extract generics into a downloadable utils helper module # - add proper try-catch-finally error handling # - support x86 and x64 builds param( [parameter(Mandatory=$true, ...
PowerShellCorpus/GithubGist/rposbo_8d55b8f76572145a8889_raw_34255d96e8ad22e2b9dbbb3e283a6f0e4602b69d_delete%20unreferenced%20images.ps1
rposbo_8d55b8f76572145a8889_raw_34255d96e8ad22e2b9dbbb3e283a6f0e4602b69d_delete%20unreferenced%20images.ps1
# cd to your project directory cd "d:\my luverly project\" # get all the images $images = Get-ChildItem "d:\my luverly project\img\" -Exclude "*.config" # for each image.. foreach($img in $images){ $found = "" # look in css, js, cshtml files for a match foreach($file in Get-ChildItem -Include ...
PowerShellCorpus/GithubGist/sheeeng_7155184_raw_4e5f63b360b758c90abad516b210bf8da7204856_EnableScript.ps1
sheeeng_7155184_raw_4e5f63b360b758c90abad516b210bf8da7204856_EnableScript.ps1
Set-ExecutionPolicy Unrestricted -scope CurrentUser
PowerShellCorpus/GithubGist/sveinn-steinarsson_f8d21f1832800bd4428a_raw_db6a5571669f694b81b9b3d70ef2c6dd17dd10b2_powerssh.ps1
sveinn-steinarsson_f8d21f1832800bd4428a_raw_db6a5571669f694b81b9b3d70ef2c6dd17dd10b2_powerssh.ps1
# Script Name: powerssh # Version: 1.1.0 (9. July, 2014) # Author: Sveinn Steinarsson # Description: Use Powershell to connect to a remote server via SSH and run a shell script/command # Prerequisite: # plink.exe in script path (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) # Examples: #...
PowerShellCorpus/GithubGist/tobynet_11127306_raw_f5aadc35f344477607436fa456c30be6887d9df6_saveAsPdf.ps1
tobynet_11127306_raw_f5aadc35f344477607436fa456c30be6887d9df6_saveAsPdf.ps1
function saveAsPdf($filename) { echo ("Converting {0}" -f $filename) $excel = New-Object -ComObject Excel.Application -Property @{visible=$false} try { $excel.AlertBeforeOverwriting = $true $workbook = $excel.Workbooks.Open($filename) $workbook.ExportAsFixedFormat( ...
PowerShellCorpus/GithubGist/alwalker_3063656_raw_bf7bf59ece92f87136d6341dadfcd5fdb1671ab4_FlacMp3.ps1
alwalker_3063656_raw_bf7bf59ece92f87136d6341dadfcd5fdb1671ab4_FlacMp3.ps1
$files = get-childitem F:\Work_Area\Music\Raw *.flac -rec foreach ($file in $files) { $artist = metaflac $file.fullname --show-tag=ARTIST $artist = $artist.split("=")[1] $title = metaflac $file.fullname --show-tag=TITLE $title = $title.split("=")[1] $album = metaflac $file.fullname --show-tag=ALBUM $album = $al...
PowerShellCorpus/GithubGist/RichardSlater_5460609_raw_94028663b18f30b6e72701642cd57c5c3353ff4d_Set-AzureMinimumInstanceCount.ps1
RichardSlater_5460609_raw_94028663b18f30b6e72701642cd57c5c3353ff4d_Set-AzureMinimumInstanceCount.ps1
$deployments = Get-AzureService | Select-Object ServiceName | Get-AzureDeployment $instances = $deployments | Select-Object ServiceName,Slot -ExpandProperty RoleInstanceList $instances | Select-Object ServiceName,Slot,RoleName | Group-Object RoleName,ServiceName,Slot -NoElement | Where-Object {$_.Count -...
PowerShellCorpus/GithubGist/atifaziz_5356241_raw_b2bca98dac9a585dc6d1aebfb023ebfe71e6ac84_ConvertTo-SqlValues.ps1
atifaziz_5356241_raw_b2bca98dac9a585dc6d1aebfb023ebfe71e6ac84_ConvertTo-SqlValues.ps1
function ConvertTo-SqlValues { [CmdletBinding()] param ( [Parameter(Mandatory = $True, ValueFromPipeline = $True)] [object]$InputObject, [string]$TableName = 'Data', [Parameter(Position = 0)] [string[]]$Property, [switch]$DontForceDateTimeOffset ) BEG...
PowerShellCorpus/GithubGist/Kr3m_7165247_raw_4588dae8f3bb5cd6da6b19d756dbcf48ebdf0882_hosts.ps1
Kr3m_7165247_raw_4588dae8f3bb5cd6da6b19d756dbcf48ebdf0882_hosts.ps1
# # Powershell script for adding/removing/showing entries to the hosts file. # # Known limitations: # - does not handle entries with comments afterwards ("<ip> <host> # comment") # $file = "C:\Windows\System32\drivers\etc\hosts" function add-host([string]$filename, [string]$ip, [string]$hostname) { r...
PowerShellCorpus/GithubGist/GuruAnt_7213597_raw_0ea672f7dcd2b7fc4d1518d3457d3f3d22bb2d9c_FindVMTemplatesWithNonPersistentDisks.ps1
GuruAnt_7213597_raw_0ea672f7dcd2b7fc4d1518d3457d3f3d22bb2d9c_FindVMTemplatesWithNonPersistentDisks.ps1
# Set up an empty array $arrTemplatesWithPersistentDrives = @() # Get all the template objects $objTemplates = Get-Template # Loop through each template ForEach ($objTemplate in $objTemplates){ # Get the drives associated with that template $objHardDisks = $objTemplate | Get-HardDisk # Loop through ea...
PowerShellCorpus/GithubGist/varemenos_6315711_raw_2f7db3acac1d65ecd7a74610b3f8b4f8911f9a73_Microsoft.PowerShell_profile.ps1
varemenos_6315711_raw_2f7db3acac1d65ecd7a74610b3f8b4f8911f9a73_Microsoft.PowerShell_profile.ps1
# Clear screen cls # Get user $USER = $PWD.toString() $USER = $USER.Remove(0, 9) # Get hostname $HOSTNAME = HOSTNAME.exe # Signs $COLON = ":" $DOLLAR = "$" function prompt { "$USER@$HOSTNAME$COLON $pwd $DOLLAR" }
PowerShellCorpus/GithubGist/mbrownnycnyc_3cd777471d768858b8ee_raw_725774d5e8200972218b4f641ce296c8edba66b6_check-filepresence.ps1
mbrownnycnyc_3cd777471d768858b8ee_raw_725774d5e8200972218b4f641ce296c8edba66b6_check-filepresence.ps1
#this script is to check for the presence of files #this will populate a variable with the specified format of today's date (see format specifier http://msdn.microsoft.com/en-us/library/8kb3ddd4%28v=vs.110%29.aspx) $yyyy = $(Get-Date -format yyyy) # "2014" $mmmm = $(Get-Date -format MMMM) # "September" $mm = $(Ge...
PowerShellCorpus/GithubGist/alanrenouf_4949574fe5977026e9fe_raw_90cd576d74324feae0a611ac1b803b31e62967c5_SnapshotCountEmail.ps1
alanrenouf_4949574fe5977026e9fe_raw_90cd576d74324feae0a611ac1b803b31e62967c5_SnapshotCountEmail.ps1
$NumberOfSnapshotsToReport = 5 $EmailFrom = "me@mymail.com" $EmailTo = "you@yourmail.com" # Add multiple with "mail1", "mail2", "Mail3" $Subject = "VMs with $NumberOfSnapshotsToReport or more snapshots" $SMTPServer = "smtp.mymailserver.com" Connect-VIServer 172.16.88.200 -User administrator@vsphere.local -Passwor...
PowerShellCorpus/GithubGist/iainbryson_5ba37c6186fef035b403_raw_fa27329ef3f7492efff8f3866e13b1cb6eefff53_MailWebPage.ps1
iainbryson_5ba37c6186fef035b403_raw_fa27329ef3f7492efff8f3866e13b1cb6eefff53_MailWebPage.ps1
#requires -Version 3 param( [string]$url = "www.example.com", [string]$subject, [string]$fromMail = "sending_account@example.com" [string[]]$toMail = ("receiving_account@example.com") [switch]$dontSend = $false ) function execRemoteScript () { param( [Object]$browser, [string]$url )...
PowerShellCorpus/GithubGist/anroots_9421460_raw_54541be46b2768d95fd78f8f27a6d139a03453de_ping.ps1
anroots_9421460_raw_54541be46b2768d95fd78f8f27a6d139a03453de_ping.ps1
# A PowerShell script to check the status (online / offline) of NODE-s # Pings each NODE with a ICMP packet to get its status # # Author Ando Roots <ando@sqroot.eu> 2014-03-05 # -------------- CONFIG ------------------- # # Node numbers to ping $NodeList = 11,12,13,14,15,16,17,18,24 # How many pings to each node. T...
PowerShellCorpus/GithubGist/kohlbrr_d7bc4af94e5a50e884ac_raw_04748950b327ed4dcbd0e77a1a58cfc7a2874def_folder_size.ps1
kohlbrr_d7bc4af94e5a50e884ac_raw_04748950b327ed4dcbd0e77a1a58cfc7a2874def_folder_size.ps1
$folderList = Get-ChildItem $rootFolder | Where-Object {$_.PSIsContainer -eq $true} foreach ($folder in $folderList) { $folderSize = Get-ChildItem $folder.FullName -Recurse -Force | Where-Object {$_.PSIsContainer -eq $false} | Measure-Object -Sum -Property Length | Select-Object Sum Write-Output "$($folder....
PowerShellCorpus/GithubGist/guitarrapc_974f676f025586491b86_raw_1ae92e8797d937c84f620bd35caebd957dcdfb05_GetDSCResource.ps1
guitarrapc_974f676f025586491b86_raw_1ae92e8797d937c84f620bd35caebd957dcdfb05_GetDSCResource.ps1
Get-DscResource
PowerShellCorpus/GithubGist/trondhindenes_f5a1bc15074e9d19e81a_raw_f93b7ebff2f50df5718d4b94c7a8a4c85e0950e8_win_feature.ps1
trondhindenes_f5a1bc15074e9d19e81a_raw_f93b7ebff2f50df5718d4b94c7a8a4c85e0950e8_win_feature.ps1
#!powershell # This file is part of Ansible. # # Copyright 2014, Paul Durivage <paul.durivage@rackspace.com> # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, ...
PowerShellCorpus/GithubGist/PaulStovell_8702700_raw_4eb0e6fd3024ab06ed7164898a74af3c6baa67df_gistfile1.ps1
PaulStovell_8702700_raw_4eb0e6fd3024ab06ed7164898a74af3c6baa67df_gistfile1.ps1
## -------------------------------------------------------------------------------------- ## Configuration ## -------------------------------------------------------------------------------------- $isEnabled = $OctopusParameters["Octopus.Action.IISWebSite.CreateOrUpdateWebSite"] if (!$isEnabled -or ![Bool]::Parse...
PowerShellCorpus/GithubGist/RobertGiesecke_54397ae8e4753ac3c1e9_raw_873a9c377f5e812fe7bf6a91db83d772784f2088_removeFilesFromRep.ps1
RobertGiesecke_54397ae8e4753ac3c1e9_raw_873a9c377f5e812fe7bf6a91db83d772784f2088_removeFilesFromRep.ps1
param( [Parameter(Mandatory=$true)] [string]$patterns ); $ErrorActionPreference = 'STOP'; if(!$patterns) { return 0; } $splitted = New-Object System.Collections.Generic.HashSet[string]; ($patterns -split ';') | % { if(!$_) { return; } $text = $_ -ireplace '^\*/', '...
PowerShellCorpus/GithubGist/peaeater_f6cd518894bc28d92001_raw_7c2eb9bfe3bd8c8bd9fac1f9d14bd3defaff6e8b_png2jpg.ps1
peaeater_f6cd518894bc28d92001_raw_7c2eb9bfe3bd8c8bd9fac1f9d14bd3defaff6e8b_png2jpg.ps1
# convert pngs to jpgs # requires imagemagick Param( [int]$size = 1000, [string]$indir = ".", [string]$outdir = $indir ) if (!(test-path $outdir)) { mkdir $outdir } $files = ls "$indir\*.*" -include *.png foreach ($file in $files) { $input = ('"{0}"' -f $file.FullName) ...
PowerShellCorpus/GithubGist/sunnyc7_11102355_raw_99cc7cc040eb7b4d92839b7669eb75058a2b1ddf_monad-distilled.ps1
sunnyc7_11102355_raw_99cc7cc040eb7b4d92839b7669eb75058a2b1ddf_monad-distilled.ps1
# Monad distilled by @dfinke # Doug's comment here - http://www.jsnover.com/blog/2011/10/01/monad-manifesto/ # Monad Manifesto - http://www.jsnover.com/Docs/MonadManifesto.pdf <# Original Jeffrey Snover / Israel Gat value proposition construct. For <Customer> who <Qualifier>, <Product> <Value Statement>. ...
PowerShellCorpus/GithubGist/mlinnell_9733cf344bba270cc5c5_raw_d9e1c4de6bff8239bf548a1727bcac4b12c8e6d6_read_and_discard.ps1
mlinnell_9733cf344bba270cc5c5_raw_d9e1c4de6bff8239bf548a1727bcac4b12c8e6d6_read_and_discard.ps1
$env:_CLUSTER_NETWORK_NAME_ = "clustername" [Reflection.Assembly]::LoadWithPartialName("System.Messaging") $q = new-object System.Messaging.MessageQueue(".\private$\queue_name") $q.peek() for($i = 1; $i -le 10000;$i++){ $q.Receive() | out-null} # For dead letter queue, use "FORMATNAME:DIRECT=OS:.\SYSTEM$;DeadXa...
PowerShellCorpus/GithubGist/SzymonPobiega_2657868_raw_7046fbb5951e52b12394a3d130c3db26e018fdfb_gistfile1.ps1
SzymonPobiega_2657868_raw_7046fbb5951e52b12394a3d130c3db26e018fdfb_gistfile1.ps1
# # The script switches IIS web applications to point to some other directory. It is very usefull when frequently changing branches. # The script assumes SVN-ish branch structure like this: # Root # | # |--Branches # | | # | |--Branch 1 # | | # | \--Branch 2 # | # \--Trunk # | # |...
PowerShellCorpus/GithubGist/oklahomaok_3695323_raw_82892d5d9e966b24cec734db9e2fec95764a90c9_ReverseGeocoding.ps1
oklahomaok_3695323_raw_82892d5d9e966b24cec734db9e2fec95764a90c9_ReverseGeocoding.ps1
# HeartRails Geo API $uri = "http://geoapi.heartrails.com/api/json?method=searchByGeoLocation" try { # 引数取得 $input = $args[0] $output = $args[1] # CSVから緯度経度を取得してGeoAPIに問い合わせる $cities = ipcsv $input | %{ iwr ($uri + "&x=" + $_.Lon + "&y=" + $_.Lat) | ConvertFrom-Json } | %{ $_.r...
PowerShellCorpus/GithubGist/ritalin_6086448_raw_fcc7bdf5186fb396856a3d54054207a7d25e7ebd_test.ps1
ritalin_6086448_raw_fcc7bdf5186fb396856a3d54054207a7d25e7ebd_test.ps1
function test($v) { $v } test $(if ($true) { "A" } else { "B" })
PowerShellCorpus/GithubGist/smurawski_9352282_raw_77dd55b14d12d533902cc2a0c79792e80ae2f96a_Netbackup%20Daily%20Report.ps1
smurawski_9352282_raw_77dd55b14d12d533902cc2a0c79792e80ae2f96a_Netbackup%20Daily%20Report.ps1
<# This Gist was created by ISEGist 03/04/2014 12:15:25 #> ################################################################################################### # # NAME: NBU-DailyReport.ps1 # # AUTHOR: Martijn Jonker # # COMMENT: Script to create a backup report from Netbackup jobs on windows...
PowerShellCorpus/GithubGist/rheid_6764157_raw_847fe816c0c7f08eb003a1463883a7dd0fee6eb3_CreateWebApplication%20SharePoint%202013.ps1
rheid_6764157_raw_847fe816c0c7f08eb003a1463883a7dd0fee6eb3_CreateWebApplication%20SharePoint%202013.ps1
$ver = $host | select version if ($ver.Version.Major -gt 1) {$Host.Runspace.ThreadOptions = "ReuseThread"} Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue Import-Module WebAdministration -ErrorAction SilentlyContinue ## #This Script Creates SharePoint Web Applications ## ## #Load...
PowerShellCorpus/GithubGist/hapylestat_6230302_raw_ae193d51f8a4712742535efe3f21b092f02aaefb_ps-create-object-with-properties.ps1
hapylestat_6230302_raw_ae193d51f8a4712742535efe3f21b092f02aaefb_ps-create-object-with-properties.ps1
#1. ========object $<variable> = New-Object PSObject -Property @{ <field 1> = <value> <field 2> = <value> } #2. ========hashtable $<variable> = @{ <name> = <value> }
PowerShellCorpus/GithubGist/jonwd7_9124181_raw_be94db3329a98d26405058778f971719b6cdbfd0_MSVC-build-qt-static.ps1
jonwd7_9124181_raw_be94db3329a98d26405058778f971719b6cdbfd0_MSVC-build-qt-static.ps1
#----------------------------------------------------------------------------- # # Copyright (c) 2013, Thierry Lelegard # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redis...
PowerShellCorpus/GithubGist/jonnii_4271442_raw_e9f8b646c9e9117a1c0eab79b0893ae90a8c3b4e_quick-restart.ps1
jonnii_4271442_raw_e9f8b646c9e9117a1c0eab79b0893ae90a8c3b4e_quick-restart.ps1
$workingDirectory = $args[0] $machine = $args[1] $environment = $args[2] $configuration = $args[3] Set-Location $workingDirectory # read the version file, which indicates which version we're going to deploy $versionFile = resolve-path ../Version $version = Get-Content $versionFile Write-Host "Deploying $v...
PowerShellCorpus/GithubGist/alienone_34a40dc03653f9af3bc6_raw_08905b6a58d65984f72539f46b66352c2cad5f07_get_status.ps1
alienone_34a40dc03653f9af3bc6_raw_08905b6a58d65984f72539f46b66352c2cad5f07_get_status.ps1
# Global Variables $LOGPATH = "C:\Temp" $PROCESSCSV = $LOGPATH + "connector_state.csv" Function CheckRemoteConnectorState{ $count = 0 $timestamp = $((get-date).ToString("yyyyMMddThhmmss")) $uuid = Get-Random -minimum 1 -maximum 9999 $username = "username\password" $secure_file = "C:\Temp\securest...
PowerShellCorpus/GithubGist/sovanesyan_3180872_raw_85c75d57b6dd88c23ef667c9fe346d370e5c95a8_gistfile1.ps1
sovanesyan_3180872_raw_85c75d57b6dd88c23ef667c9fe346d370e5c95a8_gistfile1.ps1
# Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($p...