Solved

Microsoft Azure Powershell 3 Script

Posted on 2016-10-14
4
52 Views
Last Modified: 2016-10-14
Hello Experts,

Can someone please show me how to make Powershell 3.0 run the following commands when its activated?

set-executionpolicy -executionpolicy remotesigned

Install-Module AzureRM

Install-AzureRM

Import-AzureRM

Import-Module AzureRM.Compute

$env:PSModulePath = $env:PSModulePath + ";D:\Modules"

Get-Module -ListAvailable | ?{$_.path -match "D:\\Modules"} | Import-Module

Regards

cpatte7372
0
Comment
Question by:Member_2_7966113
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 42

Expert Comment

by:Vasil Michev (MVP)
ID: 41843787
Put them in your profile? Here's an example article: http://exchangeserverpro.com/create-powershell-profile/
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 41843794
You need to update your PowerShell profile for that..
In PowerShell console run $PROFILE, this will show you the profile path. Open that file and copy paste all command to that file and restart the PowerShell console..

Profile path may look like this, if the file is not there then create one..
C:\Users\<UserName>\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

Set-executionpolicy -executionpolicy remotesigned this command you don't have to put it in profile, as this is a one time task.
0
 
LVL 1

Author Comment

by:Member_2_7966113
ID: 41843811
SubSun

Magic.

Thank you

Regards
0
 
LVL 1

Author Closing Comment

by:Member_2_7966113
ID: 41843812
Did the trick

Cheers
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
During and after that shift to cloud, one area that still poses a struggle for many organizations is what to do with their department file shares.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question