This file contains hidden or 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
$wshell = New-Object -ComObject Wscript.Shell | |
$wshell.Popup("Operation Completed",0,"Done",0x1) | |
# From https://blogs.technet.microsoft.com/heyscriptingguy/2014/04/04/powertip-use-powershell-to-display-pop-up-window/ |
This file contains hidden or 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
// ============================================================================================ | |
// Typescript is Javascript annotated with type info. | |
// "Compilation" of Typescript is (in the simple case) | |
// stripping out the type annotations. | |
var someNumber: number; | |
someNumber = 2; | |
someNumber = "bad"; // Type mismatch | |
// A slightly fancy way of telling Typescript that this variable is |
This file contains hidden or 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
@rem $E - escape | |
@rem ESC [ 7 m - reverse video | |
@rem ESC [ 0 m - normal mode | |
@rem $P - current path | |
@rem @G - greater-than sign | |
@rem $S - space | |
@prompt $E[7m$P$G$E[0m$S |
This file contains hidden or 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
/** | |
* Write the given message in a PRE element of the document. | |
*/ | |
function scribble(aMsg: string): void { | |
console.log(aMsg); | |
// Get a reference to the document's PRE element, or null if there isn't one. | |
var preElt = document.body.querySelector("pre"); | |
if (preElt) { | |
// Do nothing, we're good | |
// console.log("got preElt"); |
This file contains hidden or 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
gcm runonce | |
gcm runonce | select Definition | |
# 'gcm' is, by default, aliased to Get-Command |
This file contains hidden or 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
$env:PATH -split ";" | less | |
# 'less' is from PSCX (recommended). |
This file contains hidden or 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
$build = "7.3.5941.0"; | |
$dest = "c:\Program Files (x86)\Allscripts Sunrise\Clinical Manager Client\$build"; | |
$src = "c:\work\sxa\main\Projects/bin"; | |
ls $src | ? {$_.LastWriteTime -ge (Get-Date).AddMinutes( -5)} | cp -dest $dest -for -pass |
This file contains hidden or 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
(new-object Random).Next() | |
# Or... | |
$n = 9999999999 | |
[Math]::Floor((new-object Random).NextDouble() * $n) + 1 |
This file contains hidden or 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
ps officeclicktorun | sel Description,path | ft -au -wr |
This file contains hidden or 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
<# | |
This might help in finding that pesky windows service that's always locking you out when you change your password and reboot. | |
#> | |
# ft is Format-Table; -auto is auto column width; -wrap is wrap text if necessary | |
Get-WmiObject win32_service | sort startname,startmode,state,displayname | select StartMode,State,StartName,DisplayName | ft -auto -wrap | |
# Or you can select only certain services. | |
# '?' is 'where' alias; -match uses regular expressions; -not is (obviously) a 'not' operator. | |
Get-WmiObject win32_service | ? {-not ($_.state -match 'running')} | sort startname,displayname | select StartMode,State,StartName,DisplayName | ft -auto -wrap |