Как использовать аргумент для получения файла пути в качестве входных данных для другого скрипта в powershell?
0 I want to read a 2 of text file (Byte2.txt and FB.txt), but I dont want to put the path on the script, I want to use argument when I run the script from command line to parsing the path to my script. My expextation, when I run the script from command line : $PowerShell.exe Script.ps1 arg1 arg2 arg1 represent the path of Byte.txt and arg2 represent the path of FB.txt What I have tried: <pre> $file = $Args[0] $Data = $Args [1] $file_2 = Get-Content " " $file_2 $Data_2 = Get-content " " $Data_2
I execute that script from cmd :
$PS.exe Script.ps1 C:\User\Byte.txt C:\User\FB.txt
Richard MacCutchan
И что же происходит?