草庐IT

windows - 如何在多脚本中使用 powershell 函数?

我的C#程序应该通过打开执行powershell函数,如下所示:functionRunIE{$a=Get-ItemPropertyHKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion-nameProgramFilesDir$path=$a.ProgramFilesDir+"\InternetExplorer\iexplore.exe"&$path"www.heise.de"-extoffStart-Sleep6$shell=(New-Object-COMShell.Application)$ie=@($shell.Application.Win

windows - PowerShell 无法点源此命令,因为它是在不同的语言模式下定义的

我使用VisualStudio创建了一个Windows应用程序包,当我运行Add-AppDevPackage.ps1脚本时,我在某些计算机上遇到了这个错误。Cannotdot-sourcethiscommandbecauseitwasdefinedinadifferentlanguagemode.Toinvokethiscommandwithoutimportingitscontentsomitthe'.'operator`我觉得这与组策略有关,因为特定设备是企业发布的MicrosoftSurface2。我无法对此组策略进行任何更改。如何继续在此设备上安装此应用程序?有什么我应该特别尝