This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# TRIMMED GIST, SEE FULL Get-IMDBSearch.ps1 SCRIPT FOR DETAILS#> | |
#*------v Function Get-IMDBSearch v------ | |
Function Get-IMDBSearch { | |
<# TRIMMED #> | |
$qryUrlRoot = "http://google.com/search?q=site:imdb.com/title" ; | |
$url = "$($qryUrlRoot) $($Title.trim())" ; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# trimmed gist, see full close-WinsAll.ps1 for details #> | |
write-host -foregroundcolor green "***v ISSUING CLOSE ON _ALL_ DESKTOP WINDOWS! v***" ; | |
(get-process | ? { $_.mainwindowtitle -ne "" -and $_.processname -ne "powershell" } )| % {"proc:$($_.Name)" ; $_.CloseMainWindow() ; } ; | |
<# express equiv: KILL everything but ps, dead | |
(get-process | ? { $_.mainwindowtitle -ne "" -and $_.processname -ne "powershell" } )| stop-process ; | |
#> | |
# 10:07 AM 3/13/2018 #25 IE close: first do all IE, windows and blow past the 'Close All' prompts (only IE turns up in ShellApp): | |
$ShellApp = New-Object -ComObject Shell.Application ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; vsc-cheatsheet.ahk | |
/* TRIMMED DOWN GIST, KEY CODE BITS, SEE FULL SCRIPT FOR DETAILS | |
*/ | |
sAHKSdir :="C:\sc\ahk\ahkscripts\" | |
;;;*------v hs-vsc-cheatsheet (QuickRef) v------ | |
:!:7VSCm:: | |
capslock & F1:: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# TRIMMED gist, see full script for details #> | |
#*---------------------------v Function Get-TLogSpaceRegion v--------------------------- | |
Function Get-TLogSpaceRegion ($ExTargVers,$SiteName) { | |
If ($bDebug -eq $TRUE) { | |
Write-Host ("Get-TLogSpaceRegion,ExTargVers: " + $ExTargVers) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# TRIMMED GIST #> | |
#*----------------v Function ProcessLogs() v---------------- | |
Function ProcessLogs { | |
<# TRIMMED GIST #> | |
write-host -ForegroundColor White ((get-date).ToString("HH:mm:ss") + ": Site: " + $SiteName) | |
foreach ($Hub in $Hubs) { | |
write-host -foregroundcolor White ("-" * 10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1-line, wrapped at pipes and semi-colons for readability | |
$drvs="e","f","c" ; get-exchangeserver | | |
where{$_.isHubTransportServer -eq $true} | | |
foreach{ | |
write-host $_ ; | |
foreach ($drv in $drvs) { if (test-path \\$_\$drv`$\scripts\) { break } } ; | |
copy \\SourceServer\e$\scripts\get-HT-MsgTrk-TopTraffic-LastXMin.ps1 \\$_\$drv`$\scripts\ -whatif ; | |
} ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# comma-delimited server name array, | |
# foreach into logparser command | |
# Note: edit/update the logname string, to specify variant dates | |
# one-line follows (manually wrapped for clarity) | |
$CASs="US-HUBCAS1","US-HUBCAS2","US-HUBCAS3" ; | |
foreach ($CAS in $CASs){ | |
write-host ("`n" + $CAS) ; | |
.\logparser.exe "SELECT cs(User-Agent) as Client, count(*) as Hits INTO $CAS-EWS-ALLClients.csv FROM '\\$CAS\e$\Weblogs\W3SVC1\ex130919*.log' WHERE cs-uri-stem LIKE '%/EWS/%' GROUP BY Client ORDER BY Hits DESC" -o:csv ; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#*----------V Comment-based Help (leave blank line below) V---------- | |
<# | |
.SYNOPSIS | |
[NAME].ps1 - [1-LINE-DESC] | |
.NOTES | |
Written By: Todd Kadrie | |
Website: http://tinstoys.blogspot.com | |
Twitter: http://twitter.com/tostka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Sites = "US;AU;EU" ; | |
$Sites=$Sites.split(";") ; | |
foreach ($Site in $Sites) { | |
write-host -foregroundcolor yellow "SITE: " $Site; | |
get-exchangeserver | | |
where { $_.Site -like "*$Site" } | | |
sort AdminDisplayVersion,ServerRole,Name | | |
select Name,ServerRole,AdminDisplayVersion ; | |
} ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Array of IIS paths, stored as semi-colon-delimited string | |
$LogDirs="\\US-HUBCAS1\e$\Weblogs\W3SVC1\;\\US-HUBCAS2\e$\Weblogs\W3SVC1\" ; $LogDirs=$LogDirs.split(";") ; | |
# constants for single & double quotes | |
$sQuot = [char]34 ; $sQuotS = [char]39 ; | |
foreach ($LogDir in $LogDirs) { | |
# build the log path to today's logs | |
$sTodaysLogsStr = $LogDir ; | |
# Ex2007 IIS log filename variant | |
#$sTodaysLogsStr += "ex" ; | |
# Ex2010 variant |