Closed o-l-a-v closed 1 year ago
Get-InstalledPSResource returns the resource but incorrectly tags it as a module not script. Install-PSResource works as expected.
Install-PSResource Get-WindowsAutoPilotInfo -PassThru | select Name, Type
Name Type
---- ----
Get-WindowsAutoPilotInfo Script
Get-InstalledPSResource Get-WindowsAutoPilotInfo | select Name, Type
Name Type
---- ----
Get-WindowsAutoPilotInfo Module
Just opened a PR for one of the issues
There's also no parameter -Type, like PackageManagement\Get-Package for instance has. I'd expect that, as AFAIK both scripts and modules are PSResources.
Is a script a PSResource?
A script is a PSResource and I like the suggestion of adding a -Type parameter to the cmdlet. I opened a new issue here to track that issue separately
@alerickson
This issue isn't fixed: Shouldn't Microsoft.PowerShell.PSResourceGet\Get-InstalledPSResource
with -Path
should detect both modules and scripts if said path contains both?
Example with v0.5.23-beta23
Also, the new issue you said you created for -Type
: It links to this issue?
Prerequisites
Steps to reproduce
Testing out beta 22 manually downloaded from PowerShellGallery ( https://www.powershellgallery.com/packages/PSResourceGet ), I noticed that
Get-InstalledPSResource
does not return scripts.There's also no parameter
-Type
, likePackageManagement\Get-Package
for instance has. I'd expect that, as AFAIK both scripts and modules are PSResources.Example command, I've set the module path in user context to be outside OneDrive.
Get-InstalledPSResource -Path ('{0}\Microsoft\PowerShell\Scripts' -f $env:LOCALAPPDATA)
Expected behavior
Return a list of scripts and modules (installed by script dependencies) found in said directory.
Actual behavior
Error details
No response
Environment data
Visuals
No response