मैं एक पावरहेल स्क्रिप्ट लिखना चाहता हूं जो पैराम में लेता है और कार्यों का उपयोग करता है।पार्सहेल स्क्रिप्ट पैरा * और * फ़ंक्शंस
मैं इस कोशिश की:
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
मैं क्या साध्य के लिए पूछ रहा हूँ है? या मैं अपने अनुरोध में अनुचित हूं?
शक्तिशक्ति स्क्रिप्ट का क्रम आम तौर पर है, 1) पैरा, 2) कार्य 3) फ़ंक्शन कॉल/आदेशित cmdlets निष्पादित करने के लिए। –
क्रिस्टोफर रानी, यह एक सहायक सारांश है। यदि आपने इसे एक प्रश्न के रूप में पोस्ट किया था, तो मैंने इसे वोट दिया होगा। –
यदि आपका दिल ऐसा चाहता है तो आप टिप्पणियां वोट कर सकते हैं। :) –