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
(add-hook 'typescript-mode-hook | |
(lambda () | |
(tide-setup) | |
(flycheck-mode +1) | |
(eldoc-mode +1) | |
(company-mode) | |
(setq fill-column 120) | |
(local-set-key "\C-j" 'newline) | |
(local-set-key "\r" 'newline-and-indent) ;Auto-indent. | |
(local-set-key "\M-o" 'one-line-section-break) |
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
ls -rec | ? {-not ($_.FullName -match '\\(NUnitConsole|TestRun)\\')} | write-zip -output "$(datefn).zip" | |
#### If you want to get fancier... | |
# (1) Make a list of files touched in the last hour. | |
$fs = ls c:\work\sxa\18.4cu2\Projects\VisitRecord\VRDotNet\Portal\SXA.VR.Portal\bin ` | |
| ? {$_.LastWriteTime -ge (Get-Date).AddMinutes(-60)} | |
# (2) Add to it. The '+=' operator actually makes a new Array by copying the old Array + the entry(ies). |
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
$VerbosePreference="Continue" | |
ls .\AllscriptsGateway, .\HCServer, .\EntMgr | ? {$_.Name -match '\.msi$'} | % {sudo msiexec ('/f "' + $_.FullName + '"'),'/passive'} | |
# VERBOSE: Start-Process «msiexec» -ArgumentList «/f "C:\SCM-Setup\Installers\AllscriptsGateway\Allscripts Gateway 16.3 (488).msi"»,«/passive» | |
# VERBOSE: Start-Process «msiexec» -ArgumentList «/f "C:\SCM-Setup\Installers\HCServer\Helios Connect 16.3.msi"»,«/passive» | |
# VERBOSE: Start-Process «msiexec» -ArgumentList «/f "C:\SCM-Setup\Installers\EntMgr\Enterprise Manager for Sunrise Enterprise 16.3 (488).msi"»,«/passive» | |
# Look at me, all fancy with my Unicode guillemet characters! | |
<# |
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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Runtime.CompilerServices; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace TraceSourcePlay | |
{ |
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 |
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
(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
$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
$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
gcm runonce | |
gcm runonce | select Definition | |
# 'gcm' is, by default, aliased to Get-Command |