6

実行ダイアログから PowerShell スクリプトを実行しようとしています (スケジュールされたタスクとして使用されます)、パラメーターを渡すのに問題があります。

このスクリプトは、title と msg という名前の 2 つのパラメーターを受け取ります。スクリプトは次の場所にあります。D:\Tasks Scripts\Powershell\script.ps1

これは私がやろうとしていることです:

powershell.exe -noexit 'D:\Tasks Scripts\Powershell\script.ps1' -title 'Hello world' -msg 'This is a test message'

しかし、パラメータを読み取ると失敗します。

PowerShell で実行.\script.ps1 -title 'Hello world' -msg 'This is a test message'すると問題なく動作します。

4

2 に答える 2