Created
June 3, 2017 13:49
-
-
Save AlexSen/bb50666e950ac099c46ced0820e63d6e to your computer and use it in GitHub Desktop.
Script prepares arguments for external script, than runs external script and shows output
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
# Define external script paths and arguments | |
$ExternalScript_FullPath = "$((Get-Item $MyInvocation.MyCommand.Path).Directory.FullName)\ExternalScript.ps1" | |
$ExternalScript_Args = @{ | |
$param = $value | |
} | |
# Run External Script and save output to variable | |
Invoke-Expression "$ExternalScript_FullPath @ExternalScript_Args" | Tee-Object -Variable ExternalScript_Output | |
# Show output | |
$ExternalScript_Output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment