Can I Run PowerShell Commands Directly from a Shortcut?

0
0
Asked By CuriousBean2023 On

Hey everyone! I'm new to PowerShell and really enjoy using package managers like Scoop. I created a script to run `scoop update; scoop status`, but I've been wondering if there's a way to directly include those commands in a shortcut instead of having a separate script file. This would simplify things for me since I want to be able to just click an icon on my desktop and run those commands without needing to deal with a script. Is this possible? Thanks for your help!

1 Answer

Answered By TechyTom23 On

You can definitely run commands directly from a shortcut! Just use the following format: `powershell -Command "scoop update; scoop status"`. This way, you can click your shortcut and execute both commands without the need for a separate script. It's perfect for quick tasks like this! If you want, you could also add `-NoLogo` and `-NoExit` for a cleaner output.

NerdyNina -

This worked great for me! I added `-NoExit` as well so the window stays open. Thanks!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.