[英]PowerShell module installed manually. cmdlets found with help but not recognized when executed
I have a machine i would like to install a module on, specifically SwisPowerShell for working with SolarWinds.我有一台机器,我想在上面安装一个模块,特别是用于与 SolarWinds 一起工作的 SwisPowerShell。 Inte.net is disabled on it so i cant use install-module, so i manually downloaded the.nupkg from another machine and went through the steps of unpacking the files into the correct folders.
Inte.net 在上面被禁用,所以我不能使用安装模块,所以我从另一台机器手动下载了.nupkg 并完成了将文件解压缩到正确文件夹中的步骤。 https://learn.microsoft.com/en-us/powershell/scripting/gallery/how-to/working-with-packages/manual-download?view=powershell-7.2 .
https://learn.microsoft.com/en-us/powershell/scripting/gallery/how-to/working-with-packages/manual-download?view=powershell-7.2 。 all the.dll files and the windows powershell datafile i have tried in both directories "C:\Program Files\WindowsPowerShell\Modules\SwisPowerShell\3.1.0.343" and "C:\Users\username\Documents\WindowsPowerShell\Modules\SwisPowerShell\3.1.0.343".
我在两个目录“C:\Program Files\WindowsPowerShell\Modules\SwisPowerShell\3.1.0.343”和“C:\Users\username\Documents\WindowsPowerShell\Modules\SwisPowerShell\ 3.1.0.343”。 Importing the module with "import-module -name SwisPowerShell -Global -force -Verbose" shows that everything loads correctly, but then running "get-module SwisPowerShell -Verbose" returns nothing.
使用“import-module -name SwisPowerShell -Global -force -Verbose”导入模块表明所有内容都正确加载,但随后运行“get-module SwisPowerShell -Verbose”不会返回任何结果。 even loading each dll individually with "add-type -path "C:...\somefile.dll" shows nothing. running "get-module -ListAvailable" shows the module in both (or either) directories as they should be. using "get-help cmdletname" and "get-command cmdletname" shows the correct cmdlet definitions. trying to run any of the cmdlets returns "The term 'connect-swis' is not recognized as the name of a cmdlet, function... yada yadda" for all of the cmdlets. its like powershell sees the files but refuses to use them. Am i missing a step that tells powershell that this is a valid module to use? could it be blocked somehow? what extra steps does install-module do that a manual install does not that i could try?
甚至使用“add-type -path”C:...\somefile.dll“单独加载每个 dll 也没有任何显示。运行”get-module -ListAvailable“显示两个(或任一)目录中的模块,因为它们应该是。使用“get-help cmdletname”和“get-command cmdletname”显示了正确的 cmdlet 定义。尝试运行任何 cmdlet 返回“术语‘connect-swis’未被识别为 cmdlet 的名称,function ... yada yadda”用于所有 cmdlet。它像 powershell 一样看到文件但拒绝使用它们。我是否错过了一个步骤,告诉 powershell 这是一个有效的模块?它可以以某种方式被阻止吗?安装模块有哪些额外的步骤手动安装不是我可以尝试的吗?
Try running process monitor while installing on another machine.在另一台机器上安装时尝试运行进程监视器。 You might find out it's doing some registry changes too.
您可能会发现它也在进行一些注册表更改。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.