{"id":78125,"date":"2016-05-23T00:01:35","date_gmt":"2016-05-23T07:01:35","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/?p=78125"},"modified":"2019-02-18T09:10:46","modified_gmt":"2019-02-18T16:10:46","slug":"work-with-the-azurerm-cmdlets-part-1","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/work-with-the-azurerm-cmdlets-part-1\/","title":{"rendered":"Work with the Azure Resource Manager cmdlets \u2013 Part 1"},"content":{"rendered":"<p><strong>Summary<\/strong>: Obtain and install the AzureRM cmdlets.<\/p>\n<p>This blog post is part of a series about how to work with the Azure Resource Manager cmdlets. To get the most out of this series, read the posts in order.<\/p>\n<ul>\n<li>Work with the Azure Resource Manager cmdlets \u2013 Part 1<\/li>\n<li><a href=\"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2016\/05\/24\/work-with-the-azurerm-cmdlets-part-2\/\">Work with the Azure Resource Manager cmdlets \u2013 Part 2<\/a><\/li>\n<li><a href=\"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2016\/05\/25\/work-with-the-azurerm-cmdlets-part-3\/\">Work with the Azure Resource Manager cmdlets \u2013 Part 3<\/a><\/li>\n<li><a href=\"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2016\/05\/26\/work-with-the-azure-resource-manager-cmdlets-part-4\/\">Work with the Azure Resource Manager cmdlets \u2013 Part 4<\/a><\/li>\n<li><a href=\"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2016\/05\/27\/work-with-the-azure-resource-manager-cmdlets-part-5\/\">Work with the Azure Resource Manager cmdlets \u2013 Part 5<\/a><\/li>\n<\/ul>\n<p>After you finish this series, move on to the next two series to learn more about the Azure Resource Manager cmdlets.<\/p>\n<ul>\n<li><a href=\"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2016\/05\/30\/retrieve-azure-resource-manager-virtual-machine-properties-by-using-powershell-part-1\/\">Retrieve Azure Resource Manager virtual machine properties by using PowerShell<\/a><\/li>\n<li><a href=\"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2016\/06\/06\/create-azure-resource-manager-virtual-machines-by-using-powershell-part-1\/\">Create Azure Resource Manager virtual machines by using PowerShell<\/a><\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/>\u00a0I heard Microsoft introduced some new cmdlets to work with Azure Resource Manager.\u00a0\u00a0 Could you show me how I could install them?<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/>\u00a0Honorary Scripting Guy, Sean Kearney, is here today to introduce you to the newest cmdlets to manage the Azure Resource Manager environment.<\/p>\n<p>Most of the time when you hear about AzureRM, you hear the word <em>JSON<\/em> in the same context, and that\u2019s true. The JSON language helps you to do some incredibly powerful and complex infrastructure templates.<\/p>\n<p>However, we still have (and thank goodness!) a plethora of available Windows PowerShell cmdlets. These cmdlets are part of a new generation in that Microsoft developed them and posted them on GitHub. This allows the community to examine and offer up suggested changes directly in the code. Here are the <a href=\"https:\/\/github.com\/Azure\/azure-powershell\" target=\"_blank\">PowerShell cmdlets on GitHub<\/a>.<\/p>\n<p>To use the new cmdlets, you will need to have an environment that is running at least the Windows Management Framework Version 5. If you\u2019re using Windows 7, you\u2019ll need to upgrade to at least PowerShell Version 5.<\/p>\n<p>Now, where can you get them? You can access them in the <a href=\"http:\/\/www.powershellgallery.com\/\">PowerShell Gallery<\/a>.<\/p>\n<p>Just go to the Gallery and search for AzureRM to obtain the link.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/1-05236HSG.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-78135\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/1-05236HSG.png\" alt=\"Screenshot of search for AzureRM and results.\" width=\"679\" height=\"332\" \/><\/a><\/p>\n<p>From this point, you will see a series of modules that match this search. To download the module, simply click the <strong>AzureRM<\/strong> link directly to the right of the PowerShell logo in your returned search.<\/p>\n<p>You\u2019ll now see instructions that explain how to get the cmdlets through two samples of PowerShell cmdlets in Version 5.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/2-05236HSG.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-78136\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/2-05236HSG.png\" alt=\"Screenshot of commands to install and inspect AzureRM.\" width=\"593\" height=\"317\" \/><\/a><\/p>\n<p>What <em>inspect<\/em> means is that you can download the module to a location where you can examine it directly. This is good if security wants to review the code or if you\u2019d like to open things yourself and poke about. An example of this cmdlet in use would be:<\/p>\n<p style=\"padding-left: 30px\"><code>Save-Module \u2013Name AzureRM \u2013path C:\\Users\\John\\Downloads\\<\/code><\/p>\n<p>This will initiate a download of the AzureRM module from the PowerShell Gallery to your computer.<\/p>\n<p><em>Install<\/em> will download the module to a Common PowerShell modules folder that\u2019s discoverable by all users and is\u00a0available immediately for use. Now the simple example you can use is the one provided above.<\/p>\n<p style=\"padding-left: 30px\"><code>Install-Module \u2013name AzureRM<\/code><\/p>\n<p>You can also access it in this fashion by using the <code>Find-Module<\/code> cmdlet which searches the PowerShell Gallery for the module in question. You can then pipe that directly into <code>Install-Module<\/code>.<\/p>\n<p style=\"padding-left: 30px\"><code>Find-Module -name AzureRM | Install-Module<\/code><\/p>\n<p>If this is the first time that you\u2019re using these cmdlets, you will get a warning about downloading some software. It\u2019s okay to grab because it\u2019s part of the Open Source solution that PowerShell Gallery uses.<\/p>\n<p>There will also be a warning about downloading from an <em>Untrusted Repository<\/em>. This is because, by default, the PowerShell Get module which supplies this functionality wants you to \u201cthink twice\u201d rather than just randomly installing modules.<\/p>\n<p>Now that the modules are installed, stop by tomorrow when we\u2019ll start to actually use them by connecting to Microsoft Azure.<\/p>\n<p>I invite you to follow the Scripting Guys on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\">Twitter<\/a> and <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\" target=\"_blank\">Facebook<\/a>. If you have any questions, send email to them at <a href=\"mailto:scripter@microsoft.com\" target=\"_blank\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\">Official Scripting Guys Forum<\/a>. See you tomorrow.<\/p>\n<p>Until then, always remember that with Great PowerShell comes Great Responsibility.<\/p>\n<p><strong>Sean Kearney\n<\/strong>Honorary Scripting Guy\nCloud and Datacenter Management MVP<strong>\n<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Obtain and install the AzureRM cmdlets. This blog post is part of a series about how to work with the Azure Resource Manager cmdlets. To get the most out of this series, read the posts in order. Work with the Azure Resource Manager cmdlets \u2013 Part 1 Work with the Azure Resource Manager cmdlets [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[568,641],"tags":[56,154,45],"class_list":["post-78125","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hey-scripting-guy","category-windows-powershell","tag-guest-blogger","tag-sean-kearney","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Obtain and install the AzureRM cmdlets. This blog post is part of a series about how to work with the Azure Resource Manager cmdlets. To get the most out of this series, read the posts in order. Work with the Azure Resource Manager cmdlets \u2013 Part 1 Work with the Azure Resource Manager cmdlets [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/78125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=78125"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/78125\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=78125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=78125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=78125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}