When trying to run Psake build locally, it errors out during the init task due to not having admin rights. It may also error out when resolving modules in the build.ps1 if the specified modules are not the latest available on the gallery.
Expected Behavior
Psake tasks should be able to run with normal user privileges and gracefully alert / give option to install if module versions are outdated instead of just updating them globally.
Current Behavior
Psake will attempt to upgrade/install modules globally and will fail if not running with administrator privileges.
Possible Solution
If we intend to keep the global-update behavior, the scripts should be updated to include a #requires statement for running as administrator. Otherwise, it's probably preferable to update the CI to offer the option to upgrade globally, install locally, or continue with older versions of the modules.
Steps to Reproduce (for bugs)
Clone this repository.
CD into the project root.
.\build.ps1 -Task Init -Verbose
Screenshot
Context
Most users, most of the time, will be running the module build process from ISE/VSCode terminal or normal powershell console, and mostly not as administrator. This means they're likely to fail to build locally for reasons that aren't immediately clear; it also means that all build attempts for the project must be executed as administrator which seems unusual.
It also means that the build process is updating the global state of the node the build is running on - not so bad if it's a disposable runner, less fun for a personal workstation, especially if the user did not parse the build script first.
Your Environment
Module version used: 0.1.0
Operating System and PowerShell version: Windows 10.0.14393, PowerShell 5.1.14393.953
When trying to run Psake build locally, it errors out during the init task due to not having admin rights. It may also error out when resolving modules in the
build.ps1
if the specified modules are not the latest available on the gallery.Expected Behavior
Psake tasks should be able to run with normal user privileges and gracefully alert / give option to install if module versions are outdated instead of just updating them globally.
Current Behavior
Psake will attempt to upgrade/install modules globally and will fail if not running with administrator privileges.
Possible Solution
If we intend to keep the global-update behavior, the scripts should be updated to include a
#requires
statement for running as administrator. Otherwise, it's probably preferable to update the CI to offer the option to upgrade globally, install locally, or continue with older versions of the modules.Steps to Reproduce (for bugs)
.\build.ps1 -Task Init -Verbose
Screenshot
Context
Most users, most of the time, will be running the module build process from ISE/VSCode terminal or normal powershell console, and mostly not as administrator. This means they're likely to fail to build locally for reasons that aren't immediately clear; it also means that all build attempts for the project must be executed as administrator which seems unusual.
It also means that the build process is updating the global state of the node the build is running on - not so bad if it's a disposable runner, less fun for a personal workstation, especially if the user did not parse the build script first.
Your Environment
0.1.0
10.0.14393
, PowerShell5.1.14393.953