[PR #16] [MERGED] Add functionality to use Microsoft PowerShell Core (pwsh.exe) #6

Closed
opened 2026-03-03 13:56:46 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/KelvinTegelaar/RunAsUser/pull/16
Author: @vollbrechteric
Created: 3/26/2021
Status: Merged
Merged: 3/26/2021
Merged by: @KelvinTegelaar

Base: masterHead: master


📝 Commits (2)

  • 6969963 Add logic to check for Microsoft PowerShell v.7
  • ec4de64 Changed the logic for $pwshPath

📊 Changes

1 file changed (+12 additions, -3 deletions)

View changed files

📝 Public/Invoke-AsCurrentUser.ps1 (+12 -3)

📄 Description

This addresses the items that are issue #15

Added the switch -UseMicrosoftPowershell. When it is used the script will check if Microsoft PowerShell (aka PowerShell Core) is installed and then run the script block with that version.

This is useful in cases where an RMM uses its own version of PowerShell, or only looks for Windows PowerShell, but feature are needed from newer versions.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/KelvinTegelaar/RunAsUser/pull/16 **Author:** [@vollbrechteric](https://github.com/vollbrechteric) **Created:** 3/26/2021 **Status:** ✅ Merged **Merged:** 3/26/2021 **Merged by:** [@KelvinTegelaar](https://github.com/KelvinTegelaar) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`6969963`](https://github.com/KelvinTegelaar/RunAsUser/commit/6969963d28397f285504d6dfa5983d387e87973f) Add logic to check for Microsoft PowerShell v.7 - [`ec4de64`](https://github.com/KelvinTegelaar/RunAsUser/commit/ec4de64e5b32fab636ac4bec939f4487930cfe45) Changed the logic for $pwshPath ### 📊 Changes **1 file changed** (+12 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `Public/Invoke-AsCurrentUser.ps1` (+12 -3) </details> ### 📄 Description This addresses the items that are issue #15 Added the switch -UseMicrosoftPowershell. When it is used the script will check if Microsoft PowerShell (aka PowerShell Core) is installed and then run the script block with that version. This is useful in cases where an RMM uses its own version of PowerShell, or only looks for Windows PowerShell, but feature are needed from newer versions. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 13:56:46 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/RunAsUser#6
No description provided.