Created
July 30, 2013 19:24
-
-
Save mrcaron/6116039 to your computer and use it in GitHub Desktop.
Powershell snippets
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
# First N in file listing | |
function doSomething {} | |
ls $directory | select -first 10 | %{ &doSomething } | |
# Shutdown a list of machines with a name scheme of "machine-prefix-", numbered from 1-12 | |
(0..12) | %{ shutdown -r -t 0 -f -m $("machine-prefix" + "{0:D2}" -f $_) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment