Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create-NewPSService Requires Administrator Rights #8

Closed
michaeltlombardi opened this issue Oct 26, 2016 · 2 comments
Closed

Create-NewPSService Requires Administrator Rights #8

michaeltlombardi opened this issue Oct 26, 2016 · 2 comments

Comments

@michaeltlombardi
Copy link
Contributor

michaeltlombardi commented Oct 26, 2016

On reddit it's noted that executing Create-NewPSService requires running from an elevated prompt.

The script doesn't appear to check for elevation nor specify it as an actual requirement. Maybe we should either add an explicit test or use #requires to do so?

@matthewoestreich
Copy link
Owner

In order to create a service it needs the tool you are using (whether it is this script or not) would need to be ran as Administrator.

@michaeltlombardi
Copy link
Contributor Author

Correct, but if we inject

#requires -RunAsAdministrator

To the script it will ensure that users are running it elevated or give a useful error if they aren't rather than letting the action fail.

michaeltlombardi added a commit to michaeltlombardi/New-PSService that referenced this issue Oct 27, 2016
+ Moves the needle towards matthewoestreich#1 by making the functionality available in module format. Project is _not_ ready for full release to the gallery without unit tests (see below).
+ Separates the creation and installation of the service binaries, closes matthewoestreich#2
+ Replaces Create-NewService script with New-ScriptAsService, closes matthewoestreich#3
+ Replaced or removed all write-host from the functions, closes matthewoestreich#5
+ Does expand on (but doesn't close out) help and examples per matthewoestreich#6
+ Does **not** include unit tests as requested in matthewoestreich#7
+ Example script and comment-based help now indicates requirement for installation to have administrator rights, closes matthewoestreich#8
+ Adds the option to sign the binary at creation, closes matthewoestreich#9
+ Removes all instances of Clear-Host, fixes matthewoestreich#10
+ Most private functions have been removed, with the arguable exception of Set-ScriptAsServiceCredential which we've made public. Closes matthewoestreich#11

Overall this update also includes an example file and documentation as well as a first run at a build script for CI at a later date.
michaeltlombardi added a commit to michaeltlombardi/New-PSService that referenced this issue Oct 27, 2016
+ Moves the needle towards matthewoestreich#1 by making the functionality available in module format. Project is _not_ ready for full release to the gallery without unit tests (see below).
+ Separates the creation and installation of the service binaries, closes matthewoestreich#2
+ Replaces Create-NewService script with New-ScriptAsService, closes matthewoestreich#3
+ Replaced or removed all write-host from the functions, closes matthewoestreich#5
+ Does expand on (but doesn't close out) help and examples per matthewoestreich#6
+ Does **not** include unit tests as requested in matthewoestreich#7
+ Example script and comment-based help now indicates requirement for installation to have administrator rights, closes matthewoestreich#8
+ Adds the option to sign the binary at creation, closes matthewoestreich#9
+ Removes all instances of Clear-Host, fixes matthewoestreich#10
+ Most private functions have been removed, with the arguable exception of Set-ScriptAsServiceCredential which we've made public. Closes matthewoestreich#11

Overall this update also includes an example file and documentation as well as a first run at a build script for CI at a later date.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants