2016-12-02 104 views
0

當我嘗試在我的服務器打開的PowerShell它顯示如下錯誤上載:加載PowerShell ISE時出錯。無法運行的cmdlet

在加載擴展類型數據 文件時出現以下錯誤:Microsoft.PowerShell.Core,C : \ Windows \ System32 \ WindowsPowerShell \ v1.0 \ types.ps1xml:該文件爲 因以下驗證異常而跳過:文件 C:\ Windows \ System32 \ WindowsPowerShell \ v1.0 \ types.ps1xml不能爲 loade d,因爲其操作受軟件限制 策略阻止,例如使用組策略創建的策略。錯誤 發生在loa格式化數據文件: Microsoft.PowerShell.Core,C:\ Windows \ System32 \ WindowsPowerShell \ v1.0 \ DotNetTypes.format.ps1xml:文件爲 由於以下驗證異常而跳過:文件 C :\ Windows \ System32 \ WindowsPowerShell \ v1.0 \ DotNetTypes.format.ps1xml 無法加載,因爲其操作被軟件阻止 限制策略(例如使用組策略創建的策略)。 加載格式數據時發生錯誤file: Microsoft.PowerShell.Core,C:\ Windows \ System32 \ WindowsPowerShell \ v1.0 \ FileSystem.format.ps1xml:該文件被跳過 ,因爲以下值異常:文件 C:\ Windows \ SYSTEM32 \無線ndowsPowerShell \ v1.0 \ FileSystem.format.ps1xml 無法加載,因爲其操作受到軟件阻止 限制策略(例如使用組策略創建的策略)。 加載格式數據文件時發生錯誤: Microsoft.PowerShell .Core,C:\ Windows \ System32 \ WindowsPowerShell \ v1.0 \ PowerShellCore.format.ps1xml:因文件 C:\ Windows \ System32 \ WindowsPowerShell \ v1.0跳過文件 \ PowerShellCore.format.ps1xml c已註銷,因爲其操作受軟件 限制,例如使用組策略創建的策略。

在'模塊 'Microsoft.PowerShell.Utility'中找到'set-variable'命令,但該模塊不能被加載爲 。有關詳細信息,請運行'Import-Module Microsoft.PowerShell.Utility'。在行:0 char:0

其餘登錄用戶能夠運行腳本,但我無法。

當我嘗試運行任何cmdlet的例如

write-host 'test'

我得到這樣

writeErrorStream一個錯誤:真正的異常: System.Management.Automation。 CommandNotFoundException: 'write-host'命令在模塊 'Micro soft.PowerShell.Utility',但該模塊可能不會被加載 。有關更多信息,請運行「導入模塊Microsoft.PowerShell.Utility」。 ---> System.Management.Automation.CmdletInvocationException:文件 C:\ windows \ system32 \ windowspowershell \ v1。0 \ Modules \ Microsoft.PowerShell.Utility \ Microsoft.PowerShell.Utility.psm1 無法加載,因爲其操作是 被軟件限制策略(例如使用組策略創建的策略)阻止。 ---> System.Management.Automation.PSSecurityException:文件 C:\ windows \ system32 \ windowspowershell \ v1.0 \ Modules \ Microsoft.PowerShell.Utility \ Microsoft.PowerShell.Utility.psm1 無法加載,因爲它的操作是由軟件限制策略(例如使用組策略創建的策略)阻止的 。 ---> System.UnauthorizedAccessException:文件 C:\ windows \ system32 \ windowspowershell \ v1.0 \ Modules \ Microsoft.PowerShell.Utility \ Microsoft.PowerShell.Utility.psm1 無法加載,因爲它的操作是 被阻止軟件限制策略,例如使用組策略創建的策略。 ---內部異常堆棧跟蹤--- 結束在System.Management.Automation.AuthorizationManager.ShouldRunInternal(CommandInfo的 CommandInfo的,CommandOrigin原點,PSHost主機) 在Microsoft.PowerShell.Commands.ModuleCmdletBase.GetScriptInfoForFile(字符串 文件名,字符串& SCRIPTNAME,布爾checkExecutionPolicy) 在Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModule(PSModuleInfo parentModule,字符串文件名,字符串moduleBase,字符串前綴, SessionState的 SS,對象privateData,ImportModuleOptions &選項,ManifestProcessingFlags manifestProcessingFlags,布爾& 發現,布爾& moduleFileFound) 在Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleNamedInManifest(PSModuleInfo parentModule,ModuleSpecification moduleSpecification,字符串 moduleBase,布爾searchModulePath,字符串前綴,SessionState的SS,ImportModuleOptions選項, ManifestProcessingFlags manifestProcessingFlags,布爾 loadTypesFiles,布爾loadFormatFiles,在Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleManifest(字符串 moduleManifestPath,ExternalScriptInfo將scriptinfo,對象privateData,布爾&發現,字符串shortModuleName) 哈希表的數據,哈希表 LocalizedData會,ManifestProcessingFlags manifestProcessingFlags,版本的版本,版本requiredVersion, 可空1 requiredModuleGuid, ImportModuleOptions& options, Boolean& containedErrors) at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleManifest(ExternalScriptInfo scriptInfo, ManifestProcessingFlags manifestProcessingFlags, Version version, Version requiredVersion, Nullable 1 requiredModuleGuid,ImportModuleOptions &選項) 在Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModule(PSModuleInfo parentModule,字符串文件名,字符串moduleBase,字符串前綴, SessionState的 SS在Microsoft.PowerShell.Commands.ImportModuleCommand.ImportModule_LocallyViaName對象privateData,ImportModuleOptions &選項,ManifestProcessingFlags manifestProcessingFlags,布爾& 發現,布爾& moduleFileFound) (ImportModuleOptions importModuleOptions,String name) at Microsoft.PowerShell.Commands.ImportModuleCommand.ProcessRecord() at System.Management.Automation.CommandProcessor.ProcessRecord() ---內部異常堆棧跟蹤結束--- at System.Management .Automation.Runspaces.PipelineBase.Invoke(IEnumerable的 輸入) 在System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(運行空間 RS,布爾performSyncInvoke) 在System.Management.Automation.PowerShell。CoreInvokeHelper [TInput,TOutput](PSDataCollection 1 input, PSDataCollection 1輸出,PSInvocationSettings 設置) 在System.Management.Automation.PowerShell.CoreInvoke [TInput,TOutput]在System.Management.Automation.PowerShell(PSDataCollection 1 input, PSDataCollection 1個輸出,PSInvocationSettings設置) .InvokeT 在System.Management.Automation.CommandDiscovery.AutoloadSpecifiedModule(字符串 MODULENAME,的ExecutionContext上下文,SessionStateEntryVisibility 能見度,異常&例外) ---內部異常堆棧跟蹤的結尾--- 在System.Management.Automation。 CommandDiscovery.TryModuleAutoDiscovery(字符串 commandNa我,的ExecutionContext上下文,字符串originalCommandName, CommandOrigin commandOrigin,SearchResolutionOptions searchResolutionOptions,CommandTypes commandTypes,異常& lastError) 在System.Management.Automation.CommandDiscovery.LookupCommandInfo(字符串 命令名,CommandTypes commandTypes,SearchResolutionOptions searchResolutionOptions,CommandOrigin commandOrigin,的ExecutionContext上下文) 在System.Management.Automation.CommandDiscovery.LookupCommandProcessor(字符串 命令名,CommandOrigin commandOrigin,可空1 useLocalScope) at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource) at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context) at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext) at System.Management.Automation.Interpreter.ActionCallInstruction 6.Run(InterpretedFrame 幀) 在System.Management.Automation.Interpreter.EnterTryCatc hFinallyInstruction.Run(InterpretedFrame 幀)TargetObject:寫主機CategoryInfo: ObjectNotFound:(寫主機:字符串)[],CommandNotFoundException FullyQualifiedErrorId:CouldNotAutoloadMatchingModule ErrorDetails
:InvocationInfo:System.Management.Automation.InvocationInfo ScriptStackTrace:在,:line 1 PipelineIterationInfo:{}

請給我一個解決方案來克服這個錯誤。

+0

'sfc/scannow'?這可能會有所幫助,因爲您的系統看起來和死機一樣好 – 4c74356b41

+0

錯誤參考軟件限制策略的第一部分是AppLocker還是您網絡中使用的類似系統?作爲一個測試,你可以從域中刪除系統?或將其移入計算機OU,運行gpupdate,重新啓動,然後再試一次? –

回答

0

在上下文中,我可以看到powershell無法加載任何默認模塊。不僅如此,它也無法理解ps1xml文件。 當系統出現某些嚴重問題時會發生此問題。 我相信你應該做一個系統還原,或者你應該嘗試使用SFC的深層掃描。

希望這對你有所幫助