You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't want to create issues if it's just my understanding that's very wrong, but there's several aspects of this module that are confusing me.
PSResourceInfo has a useful Type member, but it's only values are Module, Script and None, despite supporting NuGet packages. If you Install-PSResource and provide a NuGet package, then do Get-InstalledPSResource you'll get back that package, but the Type is None. That doesn't really make much sense to me.
Save-PSResource PSFuzzyMenu -Path . used to save a script fails.
Save-PSResource: Unable to successfully install package 'PSFuzzyMenu': 'Could not find file '{redacted}\PSFuzzyMenu_InstalledScriptInfo.xml'.'
Save-PSResource: Operation is not valid due to the current state of the object.
Save-PSResource: Package(s) 'PSFuzzyMenu' could not be installed from registered repositories 'NuGetGallery, PSGallery'.
Frankly, the error is pure nonesense to anyone that doesn't understand the internals of this module, so at best the error needs to be changed. But, based on what it said I stumbled upon Save-PSResource PSFuzzyMenu -Path . -IncludeXml which works, but creates a PSFuzzyMenu_InstalledScriptInfo.xml alongside the script. That might make sense if I were "installing" the script, but I'm not. I'm "saving" the script, and don't want anything but the script saved to the location I specified.
Making assumptions here, this leads to several other questions. Why would metadata about saved resources be kept beside the resource, rather than in some global location? That seems fragile, when paths can be changed? Why is this XML file used for scripts, but not packages or modules? Why is there an -IncludeXml flag that only applies to scripts and must be included in that case?
Get-InstalledPSResource with the -Path parameter seems like it would be for finding "saved", rather than "installed" resources. And indeed, it finds packages "saved" to the path. However, it doesn't find modules or scripts "saved" there. Which causes further confusion with the -IncludeXml parameter.
I understand I'm in an unusual scenario (I'm trying to save and use resources "locally", instead of installing them globally) but all of the above behaviors are extremely confusing.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I don't want to create issues if it's just my understanding that's very wrong, but there's several aspects of this module that are confusing me.
PSResourceInfo has a useful Type member, but it's only values are Module, Script and None, despite supporting NuGet packages. If you
Install-PSResource
and provide a NuGet package, then doGet-InstalledPSResource
you'll get back that package, but the Type is None. That doesn't really make much sense to me.Save-PSResource PSFuzzyMenu -Path .
used to save a script fails.Frankly, the error is pure nonesense to anyone that doesn't understand the internals of this module, so at best the error needs to be changed. But, based on what it said I stumbled upon
Save-PSResource PSFuzzyMenu -Path . -IncludeXml
which works, but creates aPSFuzzyMenu_InstalledScriptInfo.xml
alongside the script. That might make sense if I were "installing" the script, but I'm not. I'm "saving" the script, and don't want anything but the script saved to the location I specified.Making assumptions here, this leads to several other questions. Why would metadata about saved resources be kept beside the resource, rather than in some global location? That seems fragile, when paths can be changed? Why is this XML file used for scripts, but not packages or modules? Why is there an
-IncludeXml
flag that only applies to scripts and must be included in that case?Get-InstalledPSResource
with the-Path
parameter seems like it would be for finding "saved", rather than "installed" resources. And indeed, it finds packages "saved" to the path. However, it doesn't find modules or scripts "saved" there. Which causes further confusion with the-IncludeXml
parameter.I understand I'm in an unusual scenario (I'm trying to save and use resources "locally", instead of installing them globally) but all of the above behaviors are extremely confusing.
Beta Was this translation helpful? Give feedback.
All reactions