This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sample 1 | |
$images = Get-AzureVMImage | |
$images.Count | |
$images[0] | |
# sample 2 | |
$images | Group-Object -Property OS | |
# sample 3 | |
$images | Group-Object -Property PublisherName | Sort-Object -Property Name | Format-Table -Property Count, Name -AutoSize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prepare two storage accounts with three containers source, destination, and backup. | |
## Copy from current stroage account. | |
# sample 1 | |
Get-AzureStorageBlob -Container source | |
Start-AzureStorageBlobCopy -SrcContainer source -SrcBlob test1 -DestContainer destination | |
# sample 2 | |
Get-AzureStorageBlob -Container source -Blob "*.vhd" | Start-AzureStorageBlobCopy -DestContainer destination |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# step 1: get file | |
$blobFile = Get-AzureStorageBlob -Container source | Where-Object -Property Name -eq "version.txt" | |
# step 2: create snapshot | |
$cloudBlob = $blobFile.ICloudBlob | |
$cloudBlob.CreateSnapshot() | |
# step 3: get snapshots | |
$snapshot = Get-AzureStorageBlob -Container source | Where-Object -Property SnapshotTime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-AzureSubscription -SubscriptionName "MSFT MVA Live" -CurrentStorageAccountName pktest1 | |
# sample 1 | |
$blobs = Get-AzureStorageBlob -Container vhds | |
$blobs | Format-Table -AutoSize | |
$disks = Get-AzureDisk | Select-Object -ExpandProperty MediaLink | Select-Object -ExpandProperty AbsoluteUri | |
$disks | |
$blobs | Select-Object -ExpandProperty ICloudBlob | Select-Object -ExpandProperty Uri | Select-Object -ExpandProperty AbsoluteUri |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-Module -Name Azure -ListAvailable | |
<# Output | |
Verzeichnis: C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement | |
ModuleType Version Name ExportedCommands | |
---------- ------- ---- ---------------- | |
Manifest 0.8.11 Azure {Disable-AzureServiceProjectRemoteDesktop, Enable-AzureMemcacheRole, Enable-AzureServiceProjectRemoteDesktop... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-AzurePublishSettingsFile | |
Import-AzurePublishSettingsFile 'C:\Users\pkirch\Downloads\Azure MSDN - pkirchner-11-20-2014-credentials.publishsettings' | |
<# Output | |
Id : c6244819-a8d6-4279-b492-4a47f4301c54 | |
Name : Azure MSDN - pkirchner | |
Environment : AzureCloud | |
Account : 8BC957EA7D9DA18CCEFB1E3DD820A0ECD43C8060 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-AzureSubscription | |
<# Output | |
SubscriptionId : c6244819-a8d6-4279-b492-4a47f4301c54 | |
SubscriptionName : Azure MSDN - pkirchner | |
Environment : AzureCloud | |
SupportedModes : AzureServiceManagement | |
DefaultAccount : 914193B3332ED5FFF26CECABB522B42AA08EDB0E | |
Accounts : {914193B3332ED5FFF26CECABB522B42AA08EDB0E, 8BC857EA6D9DA18CCEFB2E3DD820A1ECD43C8060} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get certificate from personal certificate store. | |
$cert = Get-Item Cert:\CurrentUser\My\096E6A67C50C4BCED9E27D51013CA92272F73FCD | |
# Add Azure subscription parameter set including name, ID, and certificate. | |
Set-AzureSubscription -SubscriptionName "Azure MSDN - pkirchner" -SubscriptionId c6244819-a8d6-4279-b492-4a47f4301c54 -Certificate $cert | |
# No output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<PublishData> | |
<PublishProfile | |
SchemaVersion="2.0" | |
PublishMethod="AzureServiceManagementAPI"> | |
<Subscription | |
ServiceManagementUrl="https://management.core.windows.net" | |
Id="c6244819-a8d6-4279-b492-4a47f4301c54" | |
Name="Azure MSDN - pkirchner" | |
ManagementCertificate="MIIKFAIBAzCCCdQGCSqGSIb3DQEHAaCCCcUEggnBMIIJvTCCBe4GCSqGSIb3DQEHAaCCBd8EggXbMIIF1zCCBdMGCyqGSIb3DQEMCgECoIIE7jCCBOowHAYKKoZIhvcNAQwBAzAOBAhuTdbdjovtNAICB9AEggTILRDqrkle82JkZdmlABtL+UYHLvzorYcnqfkj5Aa7CbUN2YQpsDgE5GTIst3A0Lj5w/25pqvT0zOIxL/oaDyqtMuAmOniu7IO+FMlOZfFkQFuayX24U83+qd/8429q8TBo/XxaGxOO1mF45embOcZN4snbp60eTs/doE/CSd+H6FrMEKyUecqE467nOXFW2pfg/7ONjZU1CJVsLtp19OZwZsZwxHsxpI7k7iD2R8rnONOK1c9fyKnv9ETcv6vcoMLvAxk0miwufQAUMePRh2zMcgJZLyZurtl+xeYppHZMMW6BW6uVOMgRsbJq3BVGX8JH4hoxpd07BALh5jPzbLjt9pJvkcPwB2zuDIHn4bErxLCD8vpBMaSPScrIUUwRk2nJ3xB+lkGL5dVS8W8nDt76PNlWbWfMGm9Vbtql4oKshsYNsb1EaFYD1ZHitvqI+3NiFnr5z0e2j3+fSDs5+dKWqdkuTpBx2IXt+j7QAx+ysthVyJzHwBTdxvS8jnQ7EFYluzs4o0Wm9+g5U |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script created by Peter Kirchner (peter.kirchner@microsoft.com); changed last on 23.04.2015. Based on script by Patrick Heyde (patrick.heyde@microsoft.com). | |
# The most current version of this script can be found at GitHub Gist: https://gist.github.com/pkirch/695eb59a532265a5dd55 | |
# Description: | |
# This script sample is part of the IT Camps Hybrid IT in Germany. | |
# This script copies VHDs from a source storage account into a destination storage account, | |
# registers the VHDs as disks, imports VM configuration files and starts the VMs. | |
# Finally the script creates a subfolder in the configuration files folder and stores | |
# RDP files to the newly created VMs. | |
#region Settings |