You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use PoshPrivilege on Windows 10 (22H2, 10.0.19045), PowerShell 7.6.3 (since I need a working Set-Acl -LiteralPath in conjunction with this, the shipped PS 5.1 is not an option).
After installing via Install-Module -Name PoshPrivilege, when trying to run any of the provided commands, I get (for example):
PS>Get-Privilege
InvalidOperation: \\local.domain\DFS\User$\Home\...\PowerShell\Modules\PoshPrivilege\0.3.0.0\Scripts\Get-Privilege.ps1:101
Line |101| [Privileges[]]$Privilege,| ~~~~~~~~~~~~~~
| Unable to find type [Privileges].
What am I missing to make this work?
The text was updated successfully, but these errors were encountered:
OK, it is a PowerShell 7 thing - in PowerShell 5.1 on the same machine PoshPrivilege works.
Through some digging (running Import-Module PoshPrivilege -Force -Verbose gave a ton of error messages pointing me in the direction of DefineDynamicAssembly), I found this.
Equipped with that knowledge, Import-Module PoshPrivilege -UseWindowsPowerShell -Force -Verbose allows PoshPrivelege to work within PowerShell 7, no errors on loading or so far for me.
On the page mentioned above I see that there's also a method to get this done implicitly, but I haven't dug further for now.
I'm trying to use PoshPrivilege on Windows 10 (22H2, 10.0.19045), PowerShell 7.6.3 (since I need a working
Set-Acl -LiteralPath
in conjunction with this, the shipped PS 5.1 is not an option).After installing via
Install-Module -Name PoshPrivilege
, when trying to run any of the provided commands, I get (for example):What am I missing to make this work?
The text was updated successfully, but these errors were encountered: