Skip to content

Sajal Choudhary

Garden Stream Nordletter Books About
Colophon Now Feeds
Evergreen TIL Shelf Stories Poems
Blog Micro Photos
Books Film TV Games
til powershell
Sajal Choudhary https://sajalchoudhary.net

Powershell Pass Variables to Invoke-Command

POWERSHELL

Refer to local variable with $using

Use the ‘$using:’ scope

$Using:variablename

references:

about Scopes - PowerShell | Microsoft Learn PowerShell: Passing variables to remote commands (powershellexplained.com)

Updated July 13, 2023 at 16:54 . Thoughts? Email me.
Posted to:
Mastodon Bluesky
About Colophon Now Evergreen TIL Stories Poems Photos Bookshelf

© 2026 Sajal Choudhary

Streak New posts for 126 consecutive weeks