PowerShell Universal 2.9.1

This is a small patch release primarily to fix the issue with searching for and installing modules from the gallery and an issue with license activation.

3 Likes

Hello Adam,

I am looking at dockerHub for 2.9.1. Cannot find it. Am I missing something?
Thank you

Containers are on their way. They build after the main production release and usually take about 10 minutes.

Perfect, Thank you Adam!

Looks like ActiveDirectory module is now missing from Integrated environment. This breaks role based login since roles.ps1 scripts reference “Get-ADGroup”

1 Like

I ended up changing my Environment to PS5.1 so that ActiveDirectory cmdlets worked, but then $Cache variables stopped working? $Session variables are still ok.

PS 5.1 Environment and cache variable? - PowerShell Universal - Ironman Software Forums

If the AD cmdlets are working in 5.1 but not the integrated environment, you should upgrade the AD cmdlets since the new ones run natively in PS7 which is what the integrated environment is running.

Can you try Get-Module ActiveDirectory -ListAvailable to see what the version is?

from the admin screen’s dashboard “console”

PS5.1 environment

Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules


ModuleType Version    Name                                ExportedCommands                          
---------- -------    ----                                ----------------                          
Manifest   1.0.0.0    ActiveDirectory                     {Add-ADCentralAccessPolicyMember, Add-A...

Integrated environment

PS> get-module -listavailable
    Directory: C:\***\***\PowerShellUniversal\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Manifest   7.0.0.0               CimCmdlets                          Core      {Get-CimAssociatedIn…
Manifest   7.0.0.0               Microsoft.PowerShell.Diagnostics    Core      {Get-WinEvent, New-W…
Manifest   7.0.0.0               Microsoft.PowerShell.Host           Core      {Start-Transcript, S…
Manifest   7.0.0.0               Microsoft.PowerShell.Management     Core      {Add-Content, Clear-…
Binary     1.2.0                 Microsoft.PowerShell.SecretManagem… Core      {Register-SecretVaul…
Binary     1.0.5                 Microsoft.PowerShell.SecretStore    Core      {Unlock-SecretStore,…
Manifest   7.0.0.0               Microsoft.PowerShell.Security       Core      {Get-Acl, Set-Acl, G…
Manifest   7.0.0.0               Microsoft.PowerShell.Utility        Core      {Export-Alias, Get-A…
Manifest   7.0.0.0               Microsoft.WSMan.Management          Core      {Disable-WSManCredSS…
Binary     3.0.12     beta       PowerShellGet                       Desk      {Find-PSResource, Ge…
Script     7.0.0.0               PSDiagnostics                       Core      {Disable-PSTrace, Di…
Manifest   1.0.0                 SecretManagement.JustinGrote.CredM… Core,Desk 
Script     2.9.1                 Universal                           Desk      {Add-UAScriptTag, Ne…
Script     3.11.1                UniversalDashboard                  Desk      {Add-UDElement, Clea…
Script     1.3.4                 UniversalDashboard.Charts           Desk      {New-UDNivoChart, Ne…
Script     1.2.0                 UniversalDashboard.CodeEditor       Desk      New-UDCodeEditor
Script     1.0.0                 UniversalDashboard.Editor           Desk      New-UDEditor
Script     1.0                   UniversalDashboard.Map              Desk      {New-UDMapIcon, New-…
Script     1.0.0                 UniversalDashboard.Style            Desk      New-UDStyle

    Directory: C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Binary     1.0.0.0               Microsoft.MonitoringAgent.PowerShe… Desk      

And that’s with “ActiveDirectory” added to the ‘modules’ field in both Environment setups (if that makes a diff, or is the correct way to bring in modules)

Yeah that’s the problem. 1.0.0.0 won’t load into PS7 unless Windows Compat is enabled and supported. AD 1.0.1.0 loads directly into PS7 without Windows Compat. Windows Compat causes all kinds of problems with PSU. It opens a new WinPS process for every runspace that won’t close until the runspace is terminated which it rarely does unless you have Runspace Recycling on and I wouldn’t suggest it. You’ll get way, way better performance installing the newer AD module.

1 Like

Thanks, bro - will look at this now.

What’s the easiest way to update the ActiveDirectory module, as it has come from enabling the RSAT feature? Or does the ActiveDirectory module 1.0.1.0 only work on Windows 10+/Server 2019+

1 Like

You might still run into a problem: ActiveDirectory module missing from Integrated environment in Powershell Universal 2.9.1 ¡ Issue #1037 ¡ ironmansoftware/issues ¡ GitHub

I think you might be able to install the new module and then import the module by path to work around it.

I see the issue. One of the problems fixed with 2.9.1 was that PackageManagement wasn’t working on some systems (couldn’t install modules from admin console). One thing we did was try to avoid loading Windows PowerShell modules by removing them from the PSModulePath which is added by default. This unintentionally broke this AD module scenario.

I fear even after the upgrade you might run into this. You should be able to load the AD module manually as a workaround.

impo C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ActiveDirectory\ActiveDirectory.psd1
1 Like

Does that mean it’ll use the WinCompat though, introducing all sorts of probs to PSU?

^^^ that’s still 1.0.0.0 ActiveDirectory, as this is running on Server 2016

I shouldn’t use WinCompat if you have 1.0.1.0 installed

what’s the best way to get to 1.0.1.0? upgrade to Server 2019?

@pharnos

http://www.maxtblog.com/2020/01/updating-activedirectory-module-in-windows-10/

Thanks, I’ve come across that page too - I’m currently running PSU on Server 2016 trying to find a way to get the 1.0.1.0 module installed

This explains the behaviour I saw, until I added -PSModulePath @(‘C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules’) to my Integrated environment.

1 Like

Where did you add this to PSModulePath? it doesn’t seem to allow arguments.

I’m rolling this change back and getting a 2.9.2 build out since this is affecting so many people. I also found an issue where we weren’t properly loading the Universal module. It should have been loading from the PSModulePath but some people were seeing it not load.

In the meantime, you can set that in environments.ps1

1 Like