我當前版本的ps是v3,但是如果我需要調用程序集「Microsoft.PowerShell.GraphicalHost」,該程序集是Windows Management Framework Core的一部分,它我已安裝,但仍然出現以下錯誤添加類型:無法加載文件或程序集'Microsoft.PowerShell.GraphicalHost,版本= 1.0 .0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或它的某個依賴項。系統不能找到指定的文件。 任何古魯都可以幫助我?如何在PowerShell版本3中調用Microsoft.PowerShell.GraphicalHost
0
A
回答
1
當我嘗試使用Out-GridView cmdlet時,出現了同樣的錯誤。
起初,我試圖加載PowerShell ISE中明確,如下所述:
Using the Out-GridView feature in PowerCLI
我gussied它一點的效率:
if ((Get-WindowsFeature -Name PowerShell-ISE -ErrorAction SilentlyContinue) -eq $null)
{
Import-Module ServerManager; Add-WindowsFeature PowerShell-ISE
}
我驗證成功:
Get-WindowsFeature PowerShell-ISE
但是,我仍然有同樣的錯誤。更重要的是,當我從命令行測試代碼時,Out-GridView cmdlet起作用了!
問題在於Quest Software的PowerGUI腳本編輯器。雖然我安裝了PowerShell v.3,但腳本編輯器仍在v.2中啓動。我更改了我的啓動快捷方式以使用「-version 3.0」選項來解決問題。
這裏就是我發現我的解決方案:
Thread: Can't use out-grid view since installing PowerGUI with Powershell V3
相關問題
- 1. 如何從Powershell 4指向Powershell版本3?
- 2. Python版本在PowerShell中
- 3. Powershell 3如何引用本地文件
- 4. 我的本地PowerShell腳本如何調用遠程PowerShell腳本?
- 5. 代碼適用於PowerShell的3版本,但不是在PowerShell的2
- 6. 如何在PowerShell中使用api重新部署TFS版本
- 7. 如何在使用'使用PowerShell運行'執行PowerShell腳本時在另一個PowerShell腳本中調用函數
- 8. Powershell調用Powershell腳本
- 9. 如何調用PowerShell中
- 10. 只有在1分鐘內調用3次PowerShell腳本時,如何繼續執行PowerShell腳本?
- 11. 如何使用Grafana版本3與kubernetes?
- 12. PowerShell:使用Powershell檢查Firefox版本
- 13. 如何調用我的dll並在PowerShell腳本中使用它
- 14. 使用PowerShell版本2
- 15. 如何通過Invoke-Command在遠程計算機上調用Powershell版本2
- 16. .count在多個PowerShell版本
- 17. 如何在Linux中使用兩個版本的libsqilite 3?
- 18. 如何在Windows Powershell中從Python調用shell腳本?
- 19. 如何在C#中調用powershell腳本的參數
- 20. 如何在PowerShell腳本中調用轉換所有模板
- 21. Powershell - 如何在Powershell腳本中以非交互方式調用cmdlet?
- 22. 如何在PowerShell版本2.0中獲取csv頭文件列表
- 23. 如何防止在發佈版本vs.s中使用Settings.bundle。調試版本?
- 24. 如何找到在Windows 3下的rails 3應用程序中的sqlite3版本?
- 25. TFS版本定義中的Powershell腳本
- 26. 如何在javascript中調用Objective-C方法在ios版本
- 27. Flex 3和Flash Player 10調試版本
- 28. 如何爲'Agile Uploader'版本3添加JavaScript回調?
- 29. 如何使父圖容器自動調整大圖(版本3)?
- 30. 如何在PowerShell v2中加載Powershell ISE 3?