Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AzureResourceInventory.ps1 has command that causes issues #182

Open
TurnerMarshall opened this issue Apr 23, 2024 · 3 comments
Open

AzureResourceInventory.ps1 has command that causes issues #182

TurnerMarshall opened this issue Apr 23, 2024 · 3 comments
Labels
question Further information is requested

Comments

@TurnerMarshall
Copy link

Line 235 and 241 of ARI/AzureResourceInventory.ps1 have "Get-InstalledModule" instead of "Get-Module"

@Claudio-Merola
Copy link
Collaborator

Hello there @TurnerMarshall

If I'm not mistaken, Get-Module does not list modules installed using Install-Module, which is the case of Import-Excel. That is way we choose to use Get-InstalledModule

@TurnerMarshall
Copy link
Author

Get-module gets all imported and any that are currently in the PSModule paths. If it was imported or sits within those paths it will show. Get-InstalledModule will show PowerShell commands that were installed with PowerShellGet. If you are not in an environment internet connected utilizing PowerShellGet becomes a more difficult task. I was able to just switch the commands in the prompt to get it to work on my end but figured depending on situations Get-Module will always work and Get-InstalledModule only works when that PSModule was brought in through that method.

@Claudio-Merola
Copy link
Collaborator

The thing is that in most cases Get-Modules will not report Import-Excel module as installed when it is indeed installed and the script will fail.

We use Get-InstalledModule cause it correctly report Import-Excel module as installed every time.

@Claudio-Merola Claudio-Merola added question Further information is requested labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants