Closed maciejkukulka closed 3 years ago
@maciejkukulka What version of Powershell are you using? You need to be on PS version 7.0 or above so that it is using the cross platform version of the powershell core.
I downloaded the new version (7.1) because on version 5.1 I had the same errors.
When trying to use Visual Studio Code terminal i get an error like this:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\Users\maciej.kukulka\Desktop> Install-Module PnP.PowerShell -AllowPrerelease
Install-Module : A parameter cannot be found that matches parameter name 'AllowPrerelease'.
At line:1 char:31
+ Install-Module PnP.PowerShell -AllowPrerelease
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Install-Module], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Install-Module
PS C:\Users\maciej.kukulka\Desktop> Install-Module PnP.PowerShell
PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'PnP.PowerShell'. Try Get-PSRepository to see all available
registered module repositories.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
+ ... $null = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
PS C:\Users\maciej.kukulka\Desktop>
I downloaded PS 7.1 on virtual machine and it works correctly.
Do I need to change some permissions on my PC?
OK, got it. I had to install PowerShellGet to make it working properly.
Install-Module -Name PowerShellGet -Force
Notice
Reporting an Issue or Missing Feature
Reporting Issue
Expected behavior
Want to install module PnP.PowerShell
Actual behavior
Getting an error like the one above.
Steps to reproduce behavior
Just
Install-Module PnP.PowerShell
What is the version of the Cmdlet module you are running?