Page 1 of 1

Problems with Microsoft Az Modules

Posted: Thu Nov 21, 2019 7:34 am
by MWinkler
To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.170
OS: Windows 10 Pro (64 Bit)
Build: v10.0.18362.0

*** Please add details and screenshots as needed below. ***

I want to use the Az Modules from MS - i imported Az.Resources (1.7.1) and Az.Accounts (1.6.4) succesfully and everything works in ISE and std. Powershell5.

Unfortunately i cannot use both modules at the same time in PowerShell Studio - if i change to "V5 - 64Bit" Profile the CMDlets in Az.Resources (ie. Get-AzADUser) not recognized but all of the Az.Accounts CMDLets (ie. Connect-AzAccount) are working. If i change to V2 Profile - the behaviour is vice-versa (all Az.Resources CMDs working and all Az.Accounts are not recognized)

What i tried so far (without success):
  • rebuild the PowerShell Studio Cache serveral times
  • import both modules in Cache Editor
  • Remove both modules in Cache Editor
  • click on Build Cache in Cache Editor
  • Reinstall both modules in Powershell itself
thanks for help in advance.

Re: Problems with Microsoft Az Modules

Posted: Thu Nov 21, 2019 7:47 am
by brittneyr
If you have imported both modules and built the cache from the cache editor, please try reloading the cache from the ribbon:
SPS_Reload-Cache.png
SPS_Reload-Cache.png (29.3 KiB) Viewed 4582 times

Re: Problems with Microsoft Az Modules

Posted: Thu Nov 21, 2019 8:22 am
by mxtrinidad
The latest version of Az module is: Az 3.0.0
Microsoft Azure PowerShell - Cmdlets to manage resources in Azure. This module is compatible with WindowsPowerShell and PowerShell Core.

Minimum PowerShell version: 5.1 (not Windows PowerShell v2).

For more information check the Az module link on the PowerShell Gallery: www.powershellgallery.com/packages/Az/3.0.0

After completing the "Reload Cache", go back to the Object Browser and verify that both modules have the correct version.
Az_01_2019-11-21_11-14-30.png
Az_01_2019-11-21_11-14-30.png (155.23 KiB) Viewed 4576 times
Az_02_2019-11-21_11-14-30.png
Az_02_2019-11-21_11-14-30.png (226.69 KiB) Viewed 4576 times
Module should be updated and cmdlets available.

Re: Problems with Microsoft Az Modules

Posted: Fri Nov 22, 2019 12:14 am
by MWinkler
The latest version of Az module is: Az 3.0.0
Az 3.0.0 is the parent module to Az.Accounts 1.6.4 and Az.Resources 1.7.1 and i want to keep it simple, but as you mentioned i installed the parent Az 3.0.0 (no changes to version numbers in Az.Accounts and Az.Resources) with:

Code: Select all

Install-Module -Name Az -RequiredVersion 3.0.0 -Scope AllUsers -Force -AllowClobber
...after that, rebuild the cache:
[attachment=]2019-11-22 08_57_33-SAPIEN PowerShell Studio 2019.png[/attachment]
2019-11-22 09_00_53-SAPIEN PowerShell Studio 2019.png
2019-11-22 09_00_53-SAPIEN PowerShell Studio 2019.png (3.62 KiB) Viewed 4536 times
...and reload the cache - same result:
with profile "V5 - 64Bit" - Get-AzADUser is "unknown" and Connect-AzAccount working
with profile "V2 - 64Bit" - Get-AzADUser works and Connect-AzAccount is "unknown"
2019-11-22 09_17-17-SAPIEN PowerShell Studio 2019.png
2019-11-22 09_17-17-SAPIEN PowerShell Studio 2019.png (6.3 KiB) Viewed 4534 times
In Object Browser the problem is also visible - with profile "V5 - 64Bit" there is no Arrow left to the module Az.Resources but an arrow left to the module Az.Accounts (and clickable) - if i switch to "V2 - 64Bit" the problem reverses (arrow Az.Resources - no arrow left to Az.Accounts)

Re: Problems with Microsoft Az Modules

Posted: Fri Nov 22, 2019 6:08 am
by mxtrinidad
In the previous post, there's a note on Az module "minimum requirement", which is Windows PowerShell v5.1.
So, this means that Windows PowerShell v2.0 is not supported.

Only Windows PowerShell v5.1 and greater (PowerShell Core -> PowerShell v7) are supported.

Re: Problems with Microsoft Az Modules

Posted: Sat Nov 23, 2019 5:34 am
by MWinkler
mxtrinidad wrote: Fri Nov 22, 2019 6:08 am Only Windows PowerShell v5.1 and greater (PowerShell Core -> PowerShell v7) are supported.
Good to know, but unfortunately this does not solve my problem - i´m using Powershell V5 (exactly v 5.1.18362.145) and as i mentioned, both modules (and all other Az modules) are working fine in Powershell ISE and Standard Powershell - only the Sapien Software does not work.

Any ideas that solves the problem with PowerShell Studio?

Re: Problems with Microsoft Az Modules

Posted: Mon Nov 25, 2019 7:03 am
by brittneyr
To clarify, is the script that is using the Az modules not able to run in PowerShell Studio? Or are you missing the intellisense for the Az modules, but the script still runs?

Re: Problems with Microsoft Az Modules

Posted: Mon Nov 25, 2019 7:41 am
by mxtrinidad
Seems to work fine in PowerShell Studio!
Az_01_2019-11-25_10-14-25.png
Az_01_2019-11-25_10-14-25.png (575.21 KiB) Viewed 4253 times
Az_02_2019-11-25_10-17-25.png
Az_02_2019-11-25_10-17-25.png (196.34 KiB) Viewed 4253 times
Try using the Cache Editor! Look for the Az module(s), and make sure the correct version of the module in question is selected,
Then, do the build cache and verify that the version has been updated.