I am trying to import module OpenSSHUtils under Win 10, PS 5.1.
The latest version (whatever the number) is apparently not available.
> Install-Module -Force OpenSSHUtils -Scope CurrentUser
PackageManagement\Install-Package : No se encontró ninguna coincidencia para el criterio de búsqueda especificado y el nombre de paquete 'OpenSSHUtils'
...
> Find-Module -Name 'OpenSSHUtils' -Verbose
VERBOSE: Detalles del repositorio: Nombre = 'PSGallery', Ubicación = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; IsRegistered = 'True'.
VERBOSE: Detalles del repositorio: Nombre = 'PSGallery', Ubicación = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; IsRegistered = 'True'.
VERBOSE: Uso del proveedor 'PowerShellGet' para buscar paquetes.
VERBOSE: No se especificó el parámetro -Repository. PowerShellGet usará todos los repositorios registrados.
VERBOSE: Obteniendo el objeto de proveedor para el proveedor de PackageManagement 'NuGet'.
VERBOSE: La ubicación especificada es 'https://www.powershellgallery.com/api/v2' y el proveedor de PackageManagement es 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='OpenSSHUtils'' for ''.
VERBOSE: Total package yield:'0' for the specified package 'OpenSSHUtils'.
PackageManagement\Find-Package : No se encontró ninguna coincidencia para el criterio de búsqueda especificado y el nombre de paquete 'OpenSSHUtils'. Prueba
Get-PSRepository para ver todos los orígenes de paquete registrados disponibles.
...
So I tried with ver 1.0.0.1
> Install-Module -Name OpenSSHUtils -RequiredVersion 1.0.0.1 -Scope CurrentUser
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet.
Are you sure you want to install the modules from 'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): y
PackageManagement\Install-Package : El módulo "OpenSSHUtils" no se puede instalar ni actualizar porque la firma Authenticode del archivo "OpenSSHUtils.psd1" no es
válida.
...
When faced with the signature issue, I tried downloading the nuget and installing locally as mentioned here, at https://www.powershellgallery.com/packages/OpenSSHUtils/1.0.0.1 . But it is apparently not available anymore ("The owner has unlisted this package. This could mean that the module is deprecated or shouldn't be used anymore.") Note that I could access individual files https://www.powershellgallery.com/packages/OpenSSHUtils/1.0.0.1/Content/OpenSSHUtils.psd1 and https://www.powershellgallery.com/packages/OpenSSHUtils/1.0.0.1/Content/OpenSSHUtils.psm1 .
So I am intrigued by a few issues. Mainly:
Other more granular questions:
psd1
and psm1
equivalent to having the nuget?Related:
Windows 10 SSH server installation does not create required services
In short, OpenSSHUtils has been deprecated by Microsoft (as you've indicated) and is no longer required. It is not recommended that you attempt to install this.
If you explain to us what feature from OpenSSHUtils you require, we can help you with a workaround.
Furthermore, this GitHub comment references most of the open issues regarding the deprecation. https://github.com/MicrosoftDocs/windowsserverdocs/issues/3400#issuecomment-658249949
This is not recommended, but I'm explaining it to give you a better understanding of custom modules. This can also be used if Install-Module
is not available on your version of PowerShell.
Where can I find the nuget package?
You've actually already linked it (https://www.powershellgallery.com/packages/OpenSSHUtils/1.0.0.1). If you click on "Manual Download" you'll be able to manually download it.
Is having the psd1 and psm1 equivalent to having the nuget?
The psd1 is all you need to be able to use the module. You'll need to manually install it.
$env:PSModulePath
to determine the locations PowerShell looks for modules on your system. The recommended location is C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ for system-wide use.C:\Users\user\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules\;c:\Program Files (x
86)\Microsoft SQL Server\110\Tools\PowerShell\Modules\;C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules;C:\Program Files\Microsoft Monitoring Agent\
Agent\PowerShell\
Create the OpenSSHUtils directory in C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
Copy the directories and folders from opensshutils.1.0.0.1.nupkg
to this location. You can discard the NuGet specific items (package, OpenSSHUtils.nuspec, _rels, package, [Content_Types].xml)
Use Get-Module -ListAvailable to verify the OpenSSHUtils Module is listed