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
This issue only affects scripts that are published to the powershell gallery, or psgalleryscripts. For the purposes of this issue, the example script I will use is "Export-PSObjectToINI," You can use "Find-Psresource" to find the "Export-PSObjectToINI" script hosted in the powershell gallery easily:
But when trying to install the script using "install-psresource", the module doesn't return any error or output, which would typically indicate the resource was successfully installed, but attempting to run the script reveals that it was not installed at all:
This is a problem that needs to be resolved, as the only way to install scripts from the powershell gallery as of now is to import the old version of powershellget and use the "install-script" command.
Expected behavior
The script should have successfully installed on the local machine.
Actual behavior
The script was not installed on the local machine
Error details
No error to be had.
Environment data
get-module powershellget; $PSVersionTable
ModuleType Version Name ExportedCommands
-------------------------------------
Binary 3.0.14 PowerShellGet {Find-PSResource,Get-PSResource,Get-PSResourceRepository,Install-PSResource...}
Key : PSVersion
Value : 5.1.22000.653
Name : PSVersion
Key : PSEdition
Value : Desktop
Name : PSEdition
Key : PSCompatibleVersions
Value : {1.0,2.0,3.0,4.0...}
Name : PSCompatibleVersions
Key : BuildVersion
Value : 10.0.22000.653
Name : BuildVersion
Key : CLRVersion
Value : 4.0.30319.42000
Name : CLRVersion
Key : WSManStackVersion
Value : 3.0
Name : WSManStackVersion
Key : PSRemotingProtocolVersion
Value : 2.3
Name : PSRemotingProtocolVersion
Key : SerializationVersion
Value : 1.1.0.1
Name : SerializationVersion
Visuals
No response
The text was updated successfully, but these errors were encountered:
This is because Install-PSResource isn't adding the install script path to the Path environment variable so it can be ran without prepending the path. In PowerShellGet v2 Install-Script did this by default and now it seems that feature hasn't been added back yet.
This is because Install-PSResource isn't adding the install script path to the Path environment variable so it can be ran without prepending the path. In PowerShellGet v2 Install-Script did this by default and now it seems that feature hasn't been added back yet.
Ahh. I see. You are right. The script is downloaded to the machine in the location you state. Maybe I will take a crack at modifying the "Install-psresource" function so that it adds the script directory to the PATH environment variable if it is not already present to fix that issue. Thanks for your help, but please keep this issue open until the issue has been addressed. Appreciate it.
Upon further discussion with the team, we feel it is best for consistency across Windows and Linux to not attempt to modify the user's/machine's environment PATH variable, rather emit a warning indicating how the user could do so and specifying the path with which to do so. The script is still installed successfully, but the user would have to modify the environment PATH variable for discoverability. cc @SydneyhSmith
Prerequisites
Steps to reproduce
This issue only affects scripts that are published to the powershell gallery, or psgalleryscripts. For the purposes of this issue, the example script I will use is "Export-PSObjectToINI," You can use "Find-Psresource" to find the "Export-PSObjectToINI" script hosted in the powershell gallery easily:

But when trying to install the script using "install-psresource", the module doesn't return any error or output, which would typically indicate the resource was successfully installed, but attempting to run the script reveals that it was not installed at all:
This is a problem that needs to be resolved, as the only way to install scripts from the powershell gallery as of now is to import the old version of powershellget and use the "install-script" command.
Expected behavior
The script should have successfully installed on the local machine.
Actual behavior
The script was not installed on the local machine
Error details
No error to be had.
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: