Skip to content

Instantly share code, notes, and snippets.

@nhtzr
Created May 15, 2022 19:28
Show Gist options
  • Save nhtzr/796fe9760bea44e6d45813f14a32a1f3 to your computer and use it in GitHub Desktop.
Save nhtzr/796fe9760bea44e6d45813f14a32a1f3 to your computer and use it in GitHub Desktop.
function su {
Start-Process powershell.exe -Verb RunAs -Args "-executionpolicy bypass -noexit -command Set-Location \`"$PWD\`"; `$env:Path += \`";$env:USERPROFILE\scoop\shims\`"; `$env:SCOOP = \`"$env:USERPROFILE\scoop\`"; `$env:XDG_CONFIG_HOME = \`"$env:USERPROFILE\.config\`"; `$env:SCOOP_STARTMENU = \`"$([Environment]::GetFolderPath('startmenu'))\`"; $args; robocopy `$([System.IO.Path]::Combine([Environment]::GetFolderPath('startmenu'), 'Programs', 'Scoop Apps'))` `$([System.IO.Path]::Combine(`$env:SCOOP_STARTMENU`, 'Programs', 'Scoop Apps', 'Admin'))` *.lnk /XO /PURGE;"
}
@nhtzr
Copy link
Author

nhtzr commented May 15, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment