Skip to content

Instantly share code, notes, and snippets.

@Cauterite
Last active February 21, 2017 07:46
Show Gist options
  • Save Cauterite/65e8305be8096f169b7f2e82bd6fe18a to your computer and use it in GitHub Desktop.
Save Cauterite/65e8305be8096f169b7f2e82bd6fe18a to your computer and use it in GitHub Desktop.
# comments
<# multiline comments #>
# running unsigned scripts
c:\> powershell -ExecutionPolicy Bypass -File foo.ps1
# filter, map
get-process |
where {$_.ProcessName -eq "svchost"} |
foreach {$_.Id}
# void statement in script block
@(5, 6) | foreach {
[void](get-date);
$_ + 1}
# special vars
# https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.core/about/about_automatic_variables
$true, $false, $null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment