Microsoft Virtualization Discussions

Required Certificate Error During PowerShell Toolkit Installation + Other Issues

TMADOCTHOMAS
12,807 Views

Hello,

I am trying to upgrade the NetApp PowerShell Toolkit from version 9.7.1 to 9.9.1, and I am finding it to be mind-numbingly confusing. First, I extracted the zip file to the download folder and tried running install.ps1 as described in the Installation Guide on page 7. I got the following error:

 

-----------------------------------------------------------------------------------------------

Suggestion [3,General]: The command install.ps1 was not found, but does exist in the current location. PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\install.ps1". See "get-help about_Command_Precedence" for more details.

-----------------------------------------------------------------------------------------------

 

I tried the recommended syntax of .\install.ps1 and got this:

 

-----------------------------------------------------------------------------------------------

.\install.ps1: File C:\Users\!tthomas1\Downloads\NetApp.ONTAP\Install.ps1 cannot be loaded. A required certificate is not within its validity period when verifying against the current system clock or the timestamp in the signed file..

-----------------------------------------------------------------------------------------------

 

Since that wasn't working, I manually exported the zip file to the appropriate Program Files location and ran this command:

 

Import-Module "C:\Program Files\WindowsPowerShell\Modules\netapp_ontap\NetApp.ONTAP\NetApp.ONTAP.psd1"

 

It results in the following error. Note I am running as admin.

 

-----------------------------------------------------------------------------------------------

Import-Module: The following error occurred while loading the extended type data file:, C:\Program Files\WindowsPowerShell\Modules\netapp_ontap\NetApp.ONTAP\DataONTAP.Type.ps1xml: The file was skipped because of the following validation exception: File C:\Program Files\WindowsPowerShell\Modules\netapp_ontap\NetApp.ONTAP\Data
ONTAP.Type.ps1xml cannot be loaded. A required certificate is not within its validity period when verifying against the
current system clock or the timestamp in the signed file...

-----------------------------------------------------------------------------------------------

 

I then abandoned the installation guide and went to the following post:

 

https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/NetApp-PowerShell-Toolkit-9-9-1-2106-released/m-p/167519

 

I tried the Install-Module command and got the following. After entering "Y", nothing happened.

 

-----------------------------------------------------------------------------------------------

PS C:\Users\!tthomas1\Downloads\NetApp.ONTAP> install-module NetApp.ONTAP

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

-----------------------------------------------------------------------------------------------

 

The last release I installed was an extremely simple executable. This is frustrating to say the least. Can someone assist?

1 ACCEPTED SOLUTION

TMADOCTHOMAS
12,564 Views

@Sapan , wow amazing how something that simple to overlook was the issue! I did not have the required version of .NET Framework installed. Once I installed it, the install.ps1 script worked great! Thank you again for the help.

View solution in original post

9 REPLIES 9

Sapan
12,720 Views

Hi Tim,

 

Apologies for the inconvenience caused. The code-sign-certificate with which we released the toolkit got expired as a result it is not allowing you to execute any install script or import module.

 

This error will be encountered to the user whose PowerShell Execution Policy is set to "AllSigned". As, a workaround until we resolve the code sign certificate issue. Please change your execution policy to "Unrestricted". Below is the cmdlet for the same

 

Set-ExecutionPolicy  Unrestricted

 

Try importing after executing above cmdlet and your issue would be resolved.

TMADOCTHOMAS
12,707 Views

Thank you @Sapan . I made the change and tried this command again:

 

-------------------------------------------------------------------------------

Import-Module "C:\Program Files\WindowsPowerShell\Modules\netapp_ontap\NetApp.ONTAP\NetApp.ONTAP.psd1"

-------------------------------------------------------------------------------

 

I got the following new error:

 

-------------------------------------------------------------------------------

Import-Module : Could not load file or assembly 'file:///C:\Program Files\WindowsPowerShell\Modules\netapp_ontap\NetApp.ONTAP\OntapiPS.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
At line:1 char:1
+ Import-Module "C:\Program Files\WindowsPowerShell\Modules\netapp_onta ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
+ FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

-------------------------------------------------------------------------------

 

I then retried the following command:

 

-------------------------------------------------------------------------------

install-module NetApp.ONTAP

-------------------------------------------------------------------------------

 

And got the following errors. I don't get why this wasn't simply packaged as an installer like the last version. It took less than 90 seconds. Any suggestions?

 

-------------------------------------------------------------------------------

NuGet provider is required to continue
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or 'C:\Users\!tthomas1\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and import the NuGet provider now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
WARNING: Unable to download the list of available providers. Check your internet connection.
PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the provider 'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags.
At C:\Program Files (x86)\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7405 char:21
+ ... $null = PackageManagement\Install-PackageProvider -Name $script:N ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider) [Install-PackageProvider], Exception
+ FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackageProvider

PackageManagement\Import-PackageProvider : No match was found for the specified search criteria and provider name 'NuGet'. Try
'Get-PackageProvider -ListAvailable' to see if the provider exists on the system.
At C:\Program Files (x86)\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7411 char:21
+ ... $null = PackageManagement\Import-PackageProvider -Name $script:Nu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (NuGet:String) [Import-PackageProvider], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.ImportPackageProvider

WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
WARNING: Unable to download the list of available providers. Check your internet connection.
PackageManagement\Get-PackageProvider : Unable to find package provider 'NuGet'. It may not be imported yet. Try 'Get-PackageProvider
-ListAvailable'.
At C:\Program Files (x86)\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7415 char:30
+ ... tProvider = PackageManagement\Get-PackageProvider -Name $script:NuGet ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power...PackageProvider:GetPackageProvider) [Get-PackageProvider], Exception
+ FullyQualifiedErrorId : UnknownProviderFromActivatedList,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackageProvider

install-module : NuGet provider is required to interact with NuGet-based repositories. Please ensure that '2.8.5.201' or newer version of NuGet
provider is installed.
At line:1 char:1
+ install-module NetApp.ONTAP
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Install-Module], InvalidOperationException
+ FullyQualifiedErrorId : CouldNotInstallNuGetProvider,Install-Module

-------------------------------------------------------------------------------

 

 

Sapan
12,663 Views

Hi Tim,

 

I checked at my end and I am not encountering any errors.

 

Can you please check the zip file properties and make sure it is (unblock). Also, try extracting the zip and importing it from some other location (non-default).

TMADOCTHOMAS
12,642 Views

Thank you @Sapan. I'm not sure what this means: "try extracting the zip and importing it from some other location (non-default)". What is the default? Which zip do you mean, the NetApp.ONTAP one or the sub-zipped folder netapp_ontap?

 

I did try unblocking the netapp_ontap zip file and unzipping it to "C:\Program Files\WindowsPowerShell\Modules\netapp_ontap\NetApp.ONTAP" again. I then re-ran this command again:

 

-------------------------------------------------------------------------------

Import-Module "C:\Program Files\WindowsPowerShell\Modules\netapp_ontap\NetApp.ONTAP\NetApp.ONTAP.psd1"

-------------------------------------------------------------------------------

 

I got the following new error:

 

-------------------------------------------------------------------------------

Import-Module : Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
At line:1 char:1
+ Import-Module "C:\Program Files\WindowsPowerShell\Modules\netapp_onta ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.ImportModuleCommand

-------------------------------------------------------------------------------

 

I then tried the install-module NetApp.ONTAP command again and got the same NuGet error as before. I tried entering the following command that was referenced in the error, but got the same error.

 

-------------------------------------------------------------------------------

Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force

-------------------------------------------------------------------------------

 

Finally, at the suggestion of the error I entered this command to see what package providers were installed. Not sure what or how I would get 'NuGet', or it I truly need it.

 

Can you please assist further? I am no PowerShell expert and have no idea what most of  these errors mean.

 

-------------------------------------------------------------------------------

Get-PackageProvider -ListAvailable

 

Name Version DynamicOptions
---- ------- --------------
msi 3.0.0.0 AdditionalArguments
msu 3.0.0.0
PowerShellGet 1.0.0.1 PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, InstallUpdate, NoPathUpdate, Filter, Tag, Includes, DscResource, RoleCapability, Command, P..
Programs 3.0.0.0 IncludeWindowsInstaller, IncludeSystemComponent

TMADOCTHOMAS
12,588 Views

@Sapan I just did a sanity check on all prerequisites and realized I actually didn't have the .NET Framework version I needed. I had thought it was the same prerequisite that had been used with prior versions, but it wasn't. I am downloading and installing that update now so we'll see what happens.

 

Should I fully uninstall the previous version before installing the new one?

TMADOCTHOMAS
12,565 Views

@Sapan , wow amazing how something that simple to overlook was the issue! I did not have the required version of .NET Framework installed. Once I installed it, the install.ps1 script worked great! Thank you again for the help.

Scott0123
8,620 Views

What was the .NET version you installed to eliminate this error?

 

Could not load file or assembly 'netstandard, Version=2.0.0.0

TMADOCTHOMAS
8,453 Views

Hi @Scott0123 , I don't recall as this was over a year ago 🙂 however it was the version mentioned in the release notes as the requirement. It was right there, I just had not paid attention to it.

Sapan
12,190 Views

The Microsoft Windows code signing certificate for the ONTAP PowerShell Toolkit version 9.9.1.2106 expired on September 2021.

Windows users might experience errors when attempting to use the package for ONTAP PowerShell Toolkit version 9.9.1.2106. ONTAP PowerShell Toolkit 9.9.1.2110 includes a new certificate and resolves the issue. Please find the latest PSTK link,

 

KB Article: PowerShell Toolkit 9.9.1.2106 code signing certificate is expired

Toolchest download link – NetApp Support Site - All Tools - NetApp.ONTAP PowerShell Toolkit

Powershell Gallery – https://www.powershellgallery.com/packages/NetApp.ONTAP/9.9.1.2110

Public