Problems with Microsoft Az Modules

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 4 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
MWinkler
Posts: 3
Last visit: Sat Nov 30, 2019 11:56 am

Problems with Microsoft Az Modules

Post 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.
User avatar
brittneyr
Site Admin
Posts: 1654
Last visit: Wed Mar 27, 2024 1:54 pm
Answers: 39
Been upvoted: 30 times

Re: Problems with Microsoft Az Modules

Post 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 4581 times
Brittney
SAPIEN Technologies, Inc.
User avatar
mxtrinidad
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

Re: Problems with Microsoft Az Modules

Post 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 4575 times
Az_02_2019-11-21_11-14-30.png
Az_02_2019-11-21_11-14-30.png (226.69 KiB) Viewed 4575 times
Module should be updated and cmdlets available.
User avatar
MWinkler
Posts: 3
Last visit: Sat Nov 30, 2019 11:56 am

Re: Problems with Microsoft Az Modules

Post 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 4535 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 4533 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)
Attachments
2019-11-22 08_57_33-SAPIEN PowerShell Studio 2019.png
2019-11-22 08_57_33-SAPIEN PowerShell Studio 2019.png (11.91 KiB) Viewed 4535 times
User avatar
mxtrinidad
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

Re: Problems with Microsoft Az Modules

Post 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.
User avatar
MWinkler
Posts: 3
Last visit: Sat Nov 30, 2019 11:56 am

Re: Problems with Microsoft Az Modules

Post 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?
User avatar
brittneyr
Site Admin
Posts: 1654
Last visit: Wed Mar 27, 2024 1:54 pm
Answers: 39
Been upvoted: 30 times

Re: Problems with Microsoft Az Modules

Post 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?
Brittney
SAPIEN Technologies, Inc.
User avatar
mxtrinidad
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

Re: Problems with Microsoft Az Modules

Post 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 4252 times
Az_02_2019-11-25_10-17-25.png
Az_02_2019-11-25_10-17-25.png (196.34 KiB) Viewed 4252 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.
This topic is 4 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.