Member_2_7966113
asked on
Microsoft Azure Import Module Assistance
the proper command is
import-module azure
c:\Program Files (x86)\Microsoft SDKs\Azure\Powershel\Resou rceManager \AzureReso urcemanage r whould be in your $env:PSModulePath
import-module azure
c:\Program Files (x86)\Microsoft SDKs\Azure\Powershel\Resou
ASKER
Hi David,
Thanks for responding.
Going to try your suggestion now.
Cheers
Thanks for responding.
Going to try your suggestion now.
Cheers
Don't include the path. Just Import-Module Azure
ASKER
Hi Jeremy
Thanks for responding.
Going to try without path now.
Cheers
Thanks for responding.
Going to try without path now.
Cheers
It's now imported and the commands are usable. Run GCM -Module Azure* and you will see all the available commands in the Azure modules.
ASKER
You need to install the Azure Powershell cmdlets on your desktop then. You can follow these steps:
https://docs.microsoft.com/en-us/powershell/azure/install-azurerm-ps
Just change AzureRM to Azure and it will install all the Azure modules.
https://docs.microsoft.com/en-us/powershell/azure/install-azurerm-ps
Just change AzureRM to Azure and it will install all the Azure modules.
ASKER
Hi Jeremy
This is exactly what I'm trying to do, but failing..
you need to install the Azure Powershell cmdlets on your desktop
This is exactly what I'm trying to do, but failing..
What version of Windows are you running on your desktop?
Were you running the powershell commands on another computer when you imported the module? (i.e. when you ran Import-Module azure)
Were you running the powershell commands on another computer when you imported the module? (i.e. when you ran Import-Module azure)
ASKER
Windows 10 Professional.
No, I wasn't running the commands on another computer when I rean Import-Module azure
Just so you know I can see all the cmdlets when I do GCM -Module Azure*, but I can't see any of them on my computer
No, I wasn't running the commands on another computer when I rean Import-Module azure
Just so you know I can see all the cmdlets when I do GCM -Module Azure*, but I can't see any of them on my computer
On your computer did you go through the install process outlined in the link I posted?
When you run Import-Module <insert module name> it won't show you anything unless something is wrong. So since you didn't get an error the commands should now be available to use in that session.
You may want to also run this to install all the Azure modules:
You may want to also run this to install all the Azure modules:
Install-Module Azure -AllowClobber -Force
Import-Module Azure
ASKER
Ahhh.... I see what you mean. However, I need to physical grap those cmdlets and upload them elsewhere.
??? Not sure what you mean?
ASKER
I'm not sure exactly all that the install process does. But you could try copying the Azure/Powershell folder to another computer and see if it works. But why not just install on the computer in question? If you're running Windows 10 it's just one line to install:
Install-Module Azure -AllowClobber -Force
Install-Module downloads and installs the module
ASKER
Trying Install-Module Azure -AllowClobber -Force now
ASKER
Ok, so I ran ' Install-Module Azure -AllowClobber -Force' and everthing seemed to go fine with no errors, but I still can't find any cmdlets on my computer.
Just so you know, all this is taking place on a single computer
Just so you know, all this is taking place on a single computer
ASKER
I thought that the command Import-Module would import the cmdlets onto my computer..
I guess I don't understand what you're trying to accomplish. Can you explain what the end goal is?
ASKER
ok, in the attached file, you will see a whole bunch of cmdlets, in particular, Get-AzureRmNetworkWatcherN extHop. I would like all of the files in the attached downloaded to my PC.
Or maybe that's not possible
AzureRM.Network.txt
Or maybe that's not possible
AzureRM.Network.txt
ASKER
Please bear in the mind the file is actually a .psd1 file
1. those are already on your computer and available to use. That's what the install process did.
2. Let's go a little bigger picture. What are you needing to do with the commands and how would you like to run them? Or what is the issue you're trying to solve?
2. Let's go a little bigger picture. What are you needing to do with the commands and how would you like to run them? Or what is the issue you're trying to solve?
https://msdn.microsoft.com/en-us/library/dd878324(v=vs.85).aspx
Module Manifests
A module manifest is a .psd1 file that contains a hash table. The keys and values in the hash table do the following things:
Describe the contents and attributes of the module.
Define the prerequisites.
Determine how the components are processed.
ASKER
Sorry for the delayed response, I had to run to catch my train...
OK, lets get to the meat and bones of what I'm trying to do. If you take a look at the following link I'm trying to 'Add modules' to the folder as described in the link,
Now, near the bottom of the page the document specifies Add Powershell function. In the script that follows, there is a line of code which states
$networkWatcher = Get-AzureRmNetworkWatcher -Name $nw.Name -ResourceGroupName $nw.ResourceGroupName
Now, when I run the function, the function states it can't find the Get-AzureRmNetworkWatcher cmdlet. It is that cmdlet that I need to upload to the folder AzureRM.Network.
I hope one of you guys is familiar with functions
Cheers
OK, lets get to the meat and bones of what I'm trying to do. If you take a look at the following link I'm trying to 'Add modules' to the folder as described in the link,
Now, near the bottom of the page the document specifies Add Powershell function. In the script that follows, there is a line of code which states
$networkWatcher = Get-AzureRmNetworkWatcher -Name $nw.Name -ResourceGroupName $nw.ResourceGroupName
Now, when I run the function, the function states it can't find the Get-AzureRmNetworkWatcher cmdlet. It is that cmdlet that I need to upload to the folder AzureRM.Network.
I hope one of you guys is familiar with functions
Cheers
Looks like you forgot the link. ;-)
ASKER
Now that you want the real meat the following is the error that I get when I run the function:
Get-AzureRmNetworkWatcher : The term 'Get-AzureRmNetworkWatcher' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
at run.ps1: line 34
+ Get-AzureRmNetworkWatcher
+ _________________________
+ CategoryInfo : ObjectNotFound: (Get-AzureRmNetworkWatcher :String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Get-AzureRmNetworkWatcherP acketCaptu re : The term 'Get-AzureRmNetworkWatcher PacketCapt ure' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
at run.ps1: line 37
+ Get-AzureRmNetworkWatcherP acketCaptu re
+ __________________________ __________ __
+ CategoryInfo : ObjectNotFound: (Get-AzureRmNetworkWatcher PacketCapt ure:String ) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Get-AzureRmNetworkWatcherP acketCaptu re : The term 'Get-AzureRmNetworkWatcher PacketCapt ure' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
at run.ps1: line 46
+ Get-AzureRmNetworkWatcherP acketCaptu re
+ __________________________ __________ __
+ CategoryInfo : ObjectNotFound: (Get-AzureRmNetworkWatcherP acketCaptu re:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Exception while executing function: Functions.AlertPacketCaptu rePowerShe ll
Microsoft.Azure.WebJobs.Ho st.Functio nInvocatio nEx…
Now you can see why I need the cmdlets
Get-AzureRmNetworkWatcher : The term 'Get-AzureRmNetworkWatcher' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
at run.ps1: line 34
+ Get-AzureRmNetworkWatcher
+ _________________________
+ CategoryInfo : ObjectNotFound: (Get-AzureRmNetworkWatcher
+ FullyQualifiedErrorId : CommandNotFoundException
Get-AzureRmNetworkWatcherP
at run.ps1: line 37
+ Get-AzureRmNetworkWatcherP
+ __________________________
+ CategoryInfo : ObjectNotFound: (Get-AzureRmNetworkWatcher
+ FullyQualifiedErrorId : CommandNotFoundException
Get-AzureRmNetworkWatcherP
at run.ps1: line 46
+ Get-AzureRmNetworkWatcherP
+ __________________________
+ CategoryInfo : ObjectNotFound: (Get-AzureRmNetworkWatcherP
+ FullyQualifiedErrorId : CommandNotFoundException
Exception while executing function: Functions.AlertPacketCaptu
Microsoft.Azure.WebJobs.Ho
Now you can see why I need the cmdlets
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Jeremy,
Going to try that now.. thanks
Going to try that now.. thanks
ASKER
You can then just upload the others. But you may want to upload all so that you make sure it's all the same version. Also, this explains why the cmdlets are not working. azurerm.network depends on azurerm.profile.
ASKER
Jeremy, that did it mate... thanks soooooooooooooo much
Glad to help. :)
ASKER
I have also tried the following:
Still no luck