Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Microsoft Azure Powershell 3 Script

Posted on 2016-10-14
4
Medium Priority
?
56 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 44

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 2000 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

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

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

There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
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 anti-spam), the admin…
Screencast - Getting to Know the Pipeline

886 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