Microsoft Azure Powershell 3 Script

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
LVL 1
Member_2_7966113Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
SubsunConnect With a Mentor Commented:
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
 
Vasil Michev (MVP)Commented:
Put them in your profile? Here's an example article: http://exchangeserverpro.com/create-powershell-profile/
0
 
Member_2_7966113Author Commented:
SubSun

Magic.

Thank you

Regards
0
 
Member_2_7966113Author Commented:
Did the trick

Cheers
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.