Powershell in Mac

Hi All,

I found that you can run PowerShell scripts on MAC. Currently I have to go to terminal and type pwsh and then ./script.ps1 and I can run the script. Does anyone know if you can add the script to the launcher as an app in MAC? I’m curious here.

Thanks.

Without having any experience on a MAC … can’t you configure a command line where you call pwsh with the script as argument? Even Windows can do this. :wink: :stuck_out_tongue_winking_eye:

Olaf! haven’t tried that yet, had to make sure the script worked first, but I’m still getting this figured out with MAC. I want to make it available to add to the dock if I can as an option. I found this article Run a script in MAC from the dock - cloudlearning365. Still got to run through it and see if it is an option. I just found it.

So I was able to do a pwsh ./script.ps1 problem is nothing pops up on the screen. I’m no apple dev, but it works fine in terminal.

What does your script do? What happens when you do a pwsh without the script?

Weird, if I run pwsh by itself, it loads a prompt that shows the current version of powershell. If I add the ./script.ps1, there is no error and it says the script is running, but no output. The script loads a list of commonly used tools that can be run, like the current drive layout, or running nslookup. The whole idea is that it can sit on the Mac OS desktop on the side.

Hmmm … sounds like you try to mimik the function of a PowerShell profile. You may read more about this here:

Screenshot 2024-02-28 at 3.55.05 PM

So, here it is, this is the output of the script when run from terminal. I worked on the script itself for months to tweak it right. I hoping to to add as a shortcut if you will to the dock like you would taskbar in Windows, so that you don’t have to open terminal every time you run it. I been trying to be slick and do dev work on a Mac though I only been using Mac for a year.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.