fuction : The term 'fuction' 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\admin\Desktop\Powershell\Powershell1.ps1:1 char:1
+ fuction pc {
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (fuction:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
答案1
您的 PowerShell 代码中存在拼写错误。您输入了功能代替功能这是一个 PowerShell 关键字。
PowerShell函数使用示例:
function Get-PowerShellProcess { Get-Process PowerShell }