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.

Powershell - Plugin

Featured Replies

Hello All, 

 

I have no experience with Unraid plugins,  I would like some help with someone to create a Powershell plugin to allow the use Powershell Remoting via SSH.

 

I am able to install it locally, BUT after a reboot, the application goes away.

Any help, or direction how to create a plugin, would be greatly appreciated.  

 

FYI, this would be perfect for an addition to NerdTools plugin.

 

INSTALL

 


## SOURCE https://docs.microsoft.com/en-us/powershell/scripting/install/install-other-linux?view=powershell-7.2

# Download the powershell '.tar.gz' archive
curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v7.2.2/powershell-7.2.2-linux-x64.tar.gz

# Create the target folder where powershell will be placed
sudo mkdir -p /opt/microsoft/powershell/7

# Expand powershell to the target folder
sudo tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7

# Set execute permissions
sudo chmod +x /opt/microsoft/powershell/7/pwsh

# Create the symbolic link that points to pwsh
sudo ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh


 

USING

At shell, type 

 

pwsh

 

Remoting Customization

 

- Create SSH file

nano /boot/config/ssh/sshd_config

 

- Content:

 

PasswordAuthentication yes
PubkeyAuthentication yes
Subsystem powershell /usr/bin/pwsh -sshs -NoLogo

 

- Save file,

- Restart SSH

 /etc/rc.d/rc.sshd restart

 

 

REMOTING FROM WINDOWS DESKTOP

 

 

$session = New-PSSession -HostName $hostname -UserName root

Id Name            Transport ComputerName    ComputerType    State         ConfigurationName     Availability
 -- ----            --------- ------------    ------------    -----         -----------------     ------------
  4 Runspace3       SSH       HOSTNAME     RemoteMachine   Opened        DefaultShell             Available
  
Invoke-Command -Session $session -ScriptBlock {hostname}
UNRAIDSERVER
  

 

 

With this, I would like to create a powershell module to control different aspects of the Unraid server.

 

Thanks.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

16 hours ago, Gaston Paquette said:

 

I am able to install it locally, BUT after a reboot, the application goes away.

Unraid runs from RAM. The only persistent media is mounted at /boot (flash drive, don't write things there unnecessarily, people get upset if your plugin prematurely wears out their licensed flash stick), and any mounted pools and array drives in /mnt.

 

Any modifications to the OS have to be reapplied on reboot.

 

I suggest doing research on current plugins and how they operate, so you can see what is best practice when dealing with the somewhat unique Unraid ecosystem.

  • 11 months later...

I've created a plugin that installs PowerShell for you if you still need 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.