Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[PLUGIN] PowerShell

Featured Replies

Greetings,

 

I've authored a plugin to install Microsoft PowerShell. The plugin is found here: https://github.com/x-radeon/unraid-powershell

 

Please note I'm not experienced with writing plugins for Unraid, so install at your own risk. I use the plugin on two of my Unraid installs to manage my BTRFS snapshots with no issues, so I know it works. If you know how to write plugins, please help improve it! :)

 

Steps to install:

 

  1. On your Unraid install go to Plugins > Install Plugin
  2. For the URL, paste in https://raw.githubusercontent.com/x-radeon/unraid-powershell/main/PowerShell.plg
  3. Click Install

 

To use PowerShell after install, type pwsh at a terminal or call pwsh in a bash script (when using 'User Scripts" for example) like so:

#!/bin/bash

pwsh /boot/config/plugins/myscripts/script.ps1

 

-xRadeon

  • 8 months later...

Is it possible to have a Docker container access pwsh.exe ?, I've installed the plugin but I can't find the directory in the file system where pwsh.exe is

Edited by Mephisto76

  • Author

When installing the plugin untars the files to this directory "/opt/microsoft/powershell/7/". The pwsh binary file is inside that directory and it's not an "exe" file, it's a native Linux binary file that's named just 'pwsh'.

 

As for docker, I guess what you could do is map "/opt/microsoft/powershell/7/" to some path in the container and then you should be able to call pwsh from that path. I don't know if it would work. Some dockers are very cut down so I'm not sure if pwsh will have access to everything it needs to run properly, but I'm not an expert or anything so maybe it will work just fine, idk.

 

Good luck!

  • 3 months later...

Does this stay after reboot?

  • Author

Yes, it will re-install after a reboot by using the already downloaded gz file.

  • 6 months later...
On 2/18/2024 at 2:29 PM, xRadeon said:

Yes, it will re-install after a reboot by using the already downloaded gz file.

 

What about any of the modules installed (for example AZ). Are they also retained post reboot?

  • Author

No, most likely not. It's installed into the ram drive, so on a reboot it has to be re-installed. Could potentially use the User Scripts plugin to auto install your module(s) on a reboot.

10 minutes ago, xRadeon said:

No, most likely not. It's installed into the ram drive, so on a reboot it has to be re-installed. Could potentially use the User Scripts plugin to auto install your module(s) on a reboot.

 

alright, thanks for clarifying.

  • 6 months later...

Greetings!

Was curios if this plugin was also compatible/would work with 7.0/7.0.1
Looking for a new way to add PowerShell without Nerdtools. Thanks! 

  • Author

Yeah, it works just fine on version 7. 👍

  • 5 months later...

Still works flawlessly. (A late) thanks for this Plugin. Had stability issues with powershell in docker containers, didn't know there was a plugin until today :)

  • Author

Yep, it's still kicking. I use it every day to do my BTRFS snapshots. 👍

  • 2 months later...

Anybody else having problems with powershell after updating to 7.2.0?

Script don't work anymore, command pwsh doesn't give me a prompt, just prints the version (7.5.3) and then nothing..

  • Author

I haven't upgraded just yet to 7.2.0. I'll try to get upgraded in the next day or two and see what's going on.

Thank you. I am not sure if it is really the update causing this or something else. But the timing makes it hard to ignore suspicious.

Edited by rwalla

  • 1 month later...

@xRadeon Any news, findings?

  • 2 weeks later...

fyi: with an update to 7.2.2 the problem has been fixed. I'm not sure if the problems was related to 7.2.0 or something on my machine caused it.. Just happy my script work again :)

  • 2 months later...
  • Author

Oh sorry man, I got super busy during the holidays and just never got around to this.

I did upgrade and powershell was still working fine for me. I think I've done another upgrade since then and it's been working.

Not sure what it was, perhaps a uninstall/reinstall of plugin could have resolved it.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.