Created
February 22, 2016 00:52
-
-
Save itpropro/11c0ebbb678895131375 to your computer and use it in GitHub Desktop.
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
#Does not work with DSC Configurations, using the $using: variable to change scopes | |
Invoke-Command -ScriptBlock (Get-Command .\DSCConfig.ps1|select -ExpandProperty ScriptBlock) -ComputerName localhost | |
Invoke-Command -FilePath ('.\' + $DSCConfig + '.ps1') -ComputerName localhost | |
#Does work with $using because of the -NoNewScope switch | |
Invoke-Command -ScriptBlock (Get-Command .\DSCConfig.ps1|select -ExpandProperty ScriptBlock) -NoNewScope |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment