PowerShell
The PowerShell forum accepts bug reports as well as feedback and suggestions. For more information, check out the PowerShell Homepage
The following is a list of the states we use to track items.
status | meaning |
---|---|
survey | We saw this and we are considering it. Please upvote if it’s important to you. |
needs more information | We don’t understand the issue and need additional details. |
investigating | We are looking at this internally to understand things like: scenario, reproduction of issue, costing, or other technical details. |
in queue | The issue is understood and in our unprioritized backlog. Your votes will be used to drive prioritization of this work. |
-
The Powershell package installed on the RHEL server on Azure has been automatically upgraded.
The Powershell package is installed on a VM on Azure (OS: Redhat Enterprise Linux 7.6).
We are running a Powershell script in a date-time job, but suddenly there is an error.
I checked and found that the Powershell package was upgraded just before execution.We are assuming that the Powershell package was automatically upgraded.
However, no one has done the work and the patch is set to not be applied automatically.How can we prevent the Powershell package from being upgraded? Tell me about it.
1 vote -
Installing PowerShell Modules in the Current User Scope of the System User
Installing PowerShell modules to the system (default) scope makes sense for modules that will be used by all users of the system. However, I prefer to not clutter the desktop of our users by dropping things in the All Users desktop. Likewise, I didn’t want to clutter the system modules of our users with modules that are really only used for system maintenance and support. Things that, frankly, don’t need to be even seen by the customers/users.
I thought it would be a non-issue. My processes run as the System user ( NT AUTHORITY\System ), and I could just Install-Module…
1 vote -
test-modulemanifest RequiredAssemblies fails on strong name preventing Publish-Module
When attempting to publish a module or test a module that has RequiredAssembly defined with a strong name, it fails saying the assembly is invalid.
RequiredAssemblies = @(
"PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"UIAutomationClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"UIAutomationProvider, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"UIAutomationTypes, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
However Add-Type -AssemblyName works perfectly with these values and the module does import correctly.
1 vote -
test-modulemanifest RequiredAssemblies fails if dll is fully qualified
Test-ModuleManifest, Update-ModuleManifest & Publish-ModuleManifest all fail if RequiredAssemblies contains the full string. This is because they all rely on Test-ModuleManifest which does not handle the fully qualified form of the assembly name.
for example UIAutomationClient will work
however the following will fail:
"UIAutomationClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"On a related topic, after editing the manifest i had to close & re-open powershell. even an import-module -Force did not allow it to see the updated module information.
Import-Module $module.Name -Force
write-host "Updated copyright for $($module.Name) old value: $($module.Copyright)"
Update-ModuleManifest -Path $module.Path -Copyright "(c) $([datetime]::Now.Year). All rights reserved." -ErrorAction Stop1 vote -
set-PSrepository doesn't respect verbose parameter
the "set-PSrepository" cmdlet of the "powershellget" module does not respect the verbose parameter. OS is windows 10.1809.
steps to reproduce:
PS C:\Users\Administrator> $PSversiontableName Value
PSVersion 5.1.17763.1007
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.1007
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1PS C:\Users\Administrator> get-command -name 'set-PSrepository'
CommandType Name Version Source
Function Set-PSRepository 2.2.2 powershellget
PS C:\Users\Administrator> powershellget\set-PSrepository -name 'PSgallery' -installationpolicy 'untrusted' -verbose:$false
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'True'; IsRegistered = 'True'.
PS…1 vote -
Find-Package has no -ScriptSourceLocation parameter
C:> Find-Package -ProviderName 'NuGet' -ScriptSourceLocation 'https://www.powershellgallery.com/api/v2/items/psscript'
Find-Package : A parameter cannot be found that matches parameter name 'ScriptSourceLocation'.
At line:1 char:37
+ Find-Package -ProviderName 'NuGet' -ScriptSourceLocation 'https://ww ...
+ ~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : InvalidArgument: (:) [Find-Package], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackagePS 21:22 C:\src
C:>$PSVersionTableName Value
PSVersion 5.1.18362.145
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.18362.145
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.11 vote -
Support for NPM type version strings in PowerShell module manifest
packages.json in NPM (NodeJS in general) supports prefixes in the version string to specify a minimum required with minor and minor/patch versions being a variable. For example,
The tilde matches the most recent minor version (the middle number). ~1.2.3 will match all 1.2.x versions but won't match 1.3.0.
The caret provides better flexibility. It will refer to the most recent major version (the first number). ^1.2.3 will match any 1.x.x release including 1.3.0, but will hold off on 2.0.0.
Also, an asterisk (*) indicates that the latest version of the module is needed.
Implementing this type of version specification in…
12 votes -
Pure Pain: Preinstalled PS Modules - Please Rationalize Them with Package Management Installs
I am trying to update Pester on Windows 2016 to 4.x because the preshipped Pester 3.4.0 emits a note about the depreciation of the -quiet switch when I use the quiet switch. This get's scooped into stdout when executing via AWS SSM remote commands. Version 3.x complains it does not understand "-Show None".
I want to update to 4.x - in which I ran into all the problems documented here: https://github.com/OneGet/oneget/issues/215
But ended up with "Install-module pester -force -SkipPublisherCheck.
So far so bad, but when I go to remove the 3.4.0 version (with admin rights) from: 'c:\program files\windowspowershell\modules\pester\3.4.0' I get…
10 votesThe issues you have encountered can be frustrating, sorry that is the case for you.
Moving this to Survey to try to gauge the scope of the problem for users generally.
We are somewhat limited by security requirements: what ships with Windows will always be tagged so that nothing can replace it easily unless it is signed by Microsoft. While Pester is part of Windows, it is not owned or developed by Microsoft, so updates delivered via the Gallery cannot be Microsoft signed.
Once the Gallery version is installed on a system, -SkipPublisherCheck is no longer required for future updates. That first experience, however, is bad.
This leaves us with a dilemma: do we stop shipping Pester in with PowerShell in the future, or do we continue to provide the feature set knowing users who update from the Gallery will encounter these issues?
Looking for feedback from as many users…
-
Update-ModuleManifest -ExternalModuleDependencies do not treated correctly a single value
This statement
Update-ModuleManifest -path $ManifestPath -ExternalModuleDependencies 'PSScriptAnalyzer'
Add this lines :
# External dependent modules of this module
ExternalModuleDependencies = 'PSScriptAnalyzer'But in this case publish-Module throw an exception :
PowerShellGet cannot resolve the module dependency 'PSScriptAnalyzer' of the module 'MyModule' on the repository 'MyGetFeed'.
Verify that the dependent module 'PSScriptAnalyzer' is available in the repository 'MyGetFeed'.
If this dependent module 'PSScriptAnalyzer' is managed externally, add it to the ExternalModuleDependencies entry in the PSData section of the module manifest.Possible 'workaround', duplicate the name :
Update-ModuleManifest -path $ManifestPath -ExternalModuleDependencies 'PSScriptAnalyzer','PSScriptAnalyzer'
2 votes -
Powershell (self) update
It would be very helpful if we could update PowerShell to newest version through PS package manager or OS included script - with all dependencies and prerequisites checks.
8 votesThis is definitely something we’re thinking about and working towards. The question becomes whether it’s “good enough” to update all the built-in modules (like MS.PS.Utility or MS.PS.Management) via PowerShellGet or if we need to actually update PowerShell itself.
As we work on PowerShell Core on GitHub (https://github.com/powershell/powershell) we’re beginning to think about how more engine work might be abstracted into individual modules (which, again, could be updated async from the Gallery).
That being said, there also is probably some value in installing PowerShell Core all up via “Install-Package” or “Update-Package”. Given that PS Core is fully side-by-side enabled, you could slap down a new version of PowerShell Core next to the one from which you’re actually running PowerShell Core.
At the same time, updating Windows PowerShell (the Windows-only edition of PowerShell that sits on top of the full, .NET Framework) from within Windows PowerShell is significantly trickier…
-
Install-PackageProvider doesn't work with proxy authentication
Install-PackageProvider cannot retrieve the list of available providers if the machine doesn't have direct access to the internet.
PS C:\Windows\system32> Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
WARNING: Unable to download the list of available providers. Check your internet connection.
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 line:1 char:1
+ Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider) [Install-Pac
kageProvider], Exception
+ FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackagePro
vider
How to reproduce:
1.…49 votes -
Windows Update Provider for Powershell Package Manager
Votes from Connect: 3
Original Date Submitted: 6/1/2015 12:20:47 AM
Description:
Contact Information
Handle: Matt McNabb
Site Name: PowerShell
Feedback ID: 1386686
Problem Description:
Please distribute Windows Updates via a package provider. This will allow browsing and installing updates via existing cmdlets such as Find-Package and Install-Package.Product Studio item created by Connect Synchronizer due to creation of feedback ID 1386686 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=1386686).
Repro Steps:
Internal BugId: 14531
67 votesThanks for the suggestion. This is something we are investigating, but no decision has been made at this time.
-
[Bug] Install-Module -Force prompts for user input when NuGet-anycpu.exe is not present
Steps to reproduce:
- Install WMF5 RTM on a fresh Windows 2012 R2 system
- Open an Administrator PS prompt and run "Install-Module Pester -Force"
Expected result: The -Force parameter causes the NuGet client to be installed without user intervention.
Actual result: The following message is displayed:
NuGet-anycpu.exe is required to continue.
PowerShellGet requires NuGet-anycpu.exe to interact with NuGet based galleries. NuGet-anycpu.exe must be available in
'C:\Program Files\PackageManagement\ProviderAssemblies' or
'C:\Users\Administrator\AppData\Local\PackageManagement\ProviderAssemblies'. For more information about NuGet provider,
see http://OneGet.org/NuGet.html. Do you want PowerShellGet to download NuGet-anycpu.exe now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"):The MSDN documentation for…
25 votesUnderstand the problem, will take a look at what we can do.
-
new-modulemanifest doesn't support ExternalModuleDependencies
In order to register external module dependencies (dependencies living in another repository), the name has to be registered in a string array property within the PSData Hashtable property in the PrivateData section in the psd1 manifest like so for registering module 'psFtp':
PrivateData = @{
PSData = @{ExternalModuleDependencies
ExternalModuleDependencies = @('psFtp')
}
} # End of PrivateData hashtableHowever, the new-modulemanifest doesn't have an -ExternalModuleDepencies parameter, nor is it possible to register externalmoduledependencies like so:
-PrivateData @{ PSData = @{ ExternalModuleDependencies = @('psFtp') } }
Which from a client perspective of the the existing new-modulemanifest api, would be an…
20 votesThanks for the comment. We will be monitoring this to see how many users are impacted by / recommending it.
-
Breaking Change: NuGet Provider is missing the -PackageSaveMode parameter
The
Install-Package
cmdlet for the NuGet repository used to expose the-PackageSaveMode
option which allowed us to specify whether to save the nupkg or just the nuspec, or both.In recent builds, the parameter is missing, breaking scripts that use it.
The default is the nupkg which takes up a lot of space and isn't too easy to work with, and I'd really prefer to have the nuspec to parse (so I can figure out which files in the package I need).
5 votes -
PowerShellGet: Install-Script can`t find directory InstalledScriptInfos when run for the first time
Repro setup
The following path exists:
~\Documents\WindowsPowerShellWindows 10 Enterprise with the following PSVersionTable:
PS C:> $PSVersionTableName Value
PSVersion 5.0.10586.122
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.10586.122
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1PS C:> [Environment]::GetFolderPath("MyDocuments")
C:\Users\JanEgil\DocumentsPS C:> $env:USERPROFILE
C:\Users\JanEgilRepro steps
Run Install-Script -Name Test-RPC -Scope CurrentUser
~\Documents\WindowsPowerShell\Scripts\Test-RPC.ps1 is created, but the following error occurs:
PS C:> Install-Script -Name Test-RPC -Scope CurrentUser
PackageManagement\Install-Package : Could not find a part of the path ~\Documents\WindowsPow
erShell\Scripts\InstalledScriptInfos\Test-RPC_InstalledScriptInfo.xml'.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:2693 char:21
+ ... $null = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : OpenError: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Packag
e], Exception
…+
1 voteJan – can you please run the following command and add the results? This may be a PSGet version thing:
Get-PackageProvider -li
-
semantic versioning
Semantic versioning does not work for PSGallery
Allow new versions of modules to be published according to semantic version.
Without semantic versioning, it is very difficult to evolve a module in a backwards compatible manner. Sometimes breaking changes are needed to get away from previous bad design decisions, but you still don't want to break existing clients, and wants to be able to provide bug fixes for those.
That is, allow v1.1 to be published, even if there is a v2.0.
See http://semver.org/ for details.
11 votesThanks for the suggestion. This one may be a bit tougher than others. However, your point is clear – there’s no way to rev an older version of a module once you have published a major version due to a breaking change.
-
Find-Package does not search all sources if -Source parameter is not supplied
I have cross posted this to the PowerShell core repo too as the same issue exists in v6 https://github.com/PowerShell/PowerShell/issues/6100
to reproduce:
Register-PackageSource -Name "nugetv2" -ProviderName NuGet -Location "http://www.nuget.org/api/v2/"
get-packagesource
Name ProviderName IsTrusted Location
nuget.org NuGet False https://api.nuget.org/v3/index.json
nugetv2 NuGet False http://www.nuget.org/api/v2/
PSGallery PowerShellGet False https://www.powershellgallery.com/api/v2/Find-Package npgsql
expected:
result returned with or without -source nugetv2acual: omitting source parameter returns package not found
This is on Powershell 5.1 on windows 8.1
Name Value
PSVersion 5.1.144
PSEdition Desktop
PSCompatibleVersions {1.0, 2
BuildVersion 10.0.141 vote -
PS for Win/10 - Need download available to repair DSIM or sfc fail
Add Win/10 to install packages:
I was unable to re-install PS from available downloads which only specify Windows 7 or Windows 8.1. Need one for Windows 10. PC was previous 8.1 which updated to Win/10. There is also no option in properties to emulate 7 or 8.
1 voteWin10 already has the latest version of PowerShell. We are working on the documentation https://github.com/PowerShell/PowerShell-Docs/issues/712
However, I’m not sure this solves your issue – Can you run powershell? If so, can you paste the results of
$PsVersionTable here? -
Should Save-Script download all modules defined as dependencies or not?
Right now, when you run the Save-Script command you end up with a script and all its module dependencies. In my case, I only wanted a script and got 100+ MB of modules too. :(
It would be better if you introduce the -IncludeModules parameter, and by default only download a script with the Save-Script.
Downloading the modules with the script makes sense for Install-Script, but not so much with Save-Script, in my opinion.
7 votes
- Don't see your idea?