paramsを取り込んで関数を使用するpowershellスクリプトを作成したいと思います。powershellスクリプトのparams *と*関数
が、私はこの試みた:
param
(
$arg
)
Func $arg;
function Func($arg)
{
Write-Output $arg;
}
を私はこれだ:
The term 'Func' is not recognized as the name
of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At func.ps1:6 char:5
+ Func <<<< $arg;
+ CategoryInfo : ObjectNotFound: (Func:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
ファインを、私は思いました。
function Func($arg)
{
Write-Output $arg;
}
param
(
$arg
)
Func $arg;
しかし、その後、私はこれを得た:私の代わりにこれを試してみましょう
The term 'param' is not recognized as the name
of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At C:\Users\akina\Documents\Work\ADDC\func.ps1:7 char:10
+ param <<<<
+ CategoryInfo : ObjectNotFound: (param:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
は私がなんとかするために求めているとは何ですか?あるいは、私の要求に不合理であるか?
powershellスクリプトの順序は、通常、1)Params、2)関数3)関数呼び出し/実行するコマンドレット順です。 –
Christopher Ranney、それは有用な集計です。これを質問として投稿した場合、私はそれを投票したでしょう。 –
あなたの心が欲しいなら、あなたはコメントを投票することができます。 :) –