Solved

Microsoft Azure Powershell 3 Script

Posted on 2016-10-14
4
29 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
  • 2
4 Comments
 
LVL 38

Expert Comment

by:Vasil Michev (MVP)
Comment Utility
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
Comment Utility
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
 

Author Comment

by:Member_2_7966113
Comment Utility
SubSun

Magic.

Thank you

Regards
0
 

Author Closing Comment

by:Member_2_7966113
Comment Utility
Did the trick

Cheers
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

How to sign a powershell script so you can prevent tampering, and only allow users to run authorised Powershell scripts
"Migrate" an SMTP relay receive connector to a new server using info from an old server.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now