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

Feature: PowerShell new syntax: gsudo { ScriptBlock } #178

Merged
merged 20 commits into from
Sep 20, 2022

Conversation

gerardog
Copy link
Owner

@gerardog gerardog commented Sep 13, 2022

Use gsudo { scriptBlock } to elevate a script block.
For example:

  • gsudo { echo (1+1) }
  • (gsudo.exe { Get-Process notepad++ } ).Id # => Serialized output.
  • gsudo { Get-Process $args } -args "notepad++ " # => Accepts primitive arguments via -args.

It's easier to wrap in { } than to put the command in a string + escape quotes.

@gerardog gerardog force-pushed the Feature.PwshSBSyntax branch 4 times, most recently from f167b42 to 27e22c6 Compare September 13, 2022 23:06
@gerardog gerardog changed the title Feature: New syntax gsudo { ScriptBlock } Feature: PowerShell new syntax: gsudo { ScriptBlock } Sep 13, 2022
@gerardog gerardog merged commit 61ea71b into master Sep 20, 2022
@gerardog gerardog temporarily deployed to release-github September 20, 2022 19:27 Inactive
@gerardog gerardog temporarily deployed to release-github September 20, 2022 19:35 Inactive
@gerardog gerardog temporarily deployed to github-pages September 20, 2022 19:35 Inactive
@gerardog gerardog deleted the Feature.PwshSBSyntax branch October 4, 2022 17:38
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

Successfully merging this pull request may close these issues.

Feature: gsudo {scriptblock} easier syntax to elevate scriptblocks on powershell.
1 participant