1
私は、次のPowerShellのコードを持っている:私は、私はそれを保存し、PS1ファイルとしてそれを実行すると、それは動作しますが、それ自身の上でそれぞれの行を実行するとコピー項目
Enter-PSSession -ComputerName test01
New-PSDrive -Name Source -PSProvider FileSystem -Root \\test02\SMBTest -Credential test\Administrator
Copy-Item Source:\Test.txt -Destination C:\Temp
Remove-PSDrive Source
Exit-PSSession
をそれ何もしない。 (私はPowerShellの--version 5.1を使用しています)なぜ
は、誰もがtheincorrigible1 @
なぜセッションでスクリプトを入力していますか? 'Invoke-Command'を利用します。私はあなたが第3ホップの問題にぶつかっていると思いますが – TheIncorrigible1