PowerShellでInvoke-Expression
コマンドレットを使用してモジュールをロードしています。DownloadStringパスエラー
次のコードは意図したとおりに動作します。
$url="http://pastebin.com/raw/FuxtpN69"
IEX (New-Object System.Net.Webclient).DownloadString($url)
しかし、変数を使用してドメインとページを分割しようとします。
$u="http://pastebin.com"
$rl="/raw/FuxtpN69"
$url="$u$rl"
IEX (New-Object System.Net.Webclient).DownloadString($url)
私は次のパスのエラーを取得:
Exception calling "DownloadString" with "1" argument(s): "The given path's format is not supported."
At line:8 char:53
+ IEX (New-Object System.Net.Webclient).DownloadString <<<< ($url)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
誰かが私を助けることができますか?前もって感謝します。
これは私のために働く。どのPowerShellのバージョンを使用していますか? –
私はバージョン2を使用しています。 – BobBackers
バージョン2で実行することもできます。あなたのサンプルをコピーして試してみることはできますか? –