Skip to content

Instantly share code, notes, and snippets.

View MCKLMT's full-sized avatar

Mickaël Mottet MCKLMT

View GitHub Profile
Import-Module Az.Accounts
Import-Module Az.KeyVault
Import-Module Az.Storage
# To create run as account https://docs.microsoft.com/en-us/azure/automation/create-run-as-account#create-account-using-powershell
$backupFolder = "$env:Temp\KeyVaultBackup"
$keyvaultName = 'demokeyvaultmimott'
@MCKLMT
MCKLMT / seedutil.md
Created October 29, 2020 10:13 — forked from pookjw/seedutil.md
Enroll macOS Beta Seed without profile installation

seedutil

Enroll macOS Beta Seed without profile installation

Usage

$ sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil 
usage: seedutil enroll SEED_PROGRAM
    seedutil unenroll

seedutil current

@MCKLMT
MCKLMT / Move-AzureVMInNewCS.ps1
Created November 8, 2017 14:43 — forked from GabrieleCastellani/Move-AzureVMInNewCS.ps1
Moving an Azure Virtual Machines in a different Cloud Service with Poweshell [interactive]
#Open Azure Powershell
#Import your Azure Subscription
Add-AzureAccount
#Get the list of Azure Subscriptions
Get-AzureSubscription
#Select the azure Subscription of the Virtual Machines
Select-AzureSubscription "[SubscriptionName]"
Get-Disk | `
Where partitionstyle -eq 'raw' | `
Initialize-Disk -PartitionStyle MBR -PassThru | `
New-Partition -AssignDriveLetter -UseMaximumSize | `
Format-Volume -FileSystem NTFS -NewFileSystemLabel "datadisk" -Confirm:$false
@MCKLMT
MCKLMT / Resize ARM VM.ps1
Created January 28, 2016 14:28
Resize VMs in a Resource Group
Login-AzureRmAccount
$ResourceGroupName = "INFLAB"
$NewSize = "Basic_A3"
$vms = Find-AzureRmResource -ResourceGroupName $ResourceGroupName -ResourceType Microsoft.Compute/virtualMachines
foreach ($vm in $vms)
{
$newvm = Get-AzureRMVM -ResourceGroupName $ResourceGroupName -name $vm.Name
@MCKLMT
MCKLMT / CreateFTP
Last active August 29, 2015 14:16
Create FTP on Azure with PowerShell in less than 9 minutes
Import-Module Azure # SDK 0.6.15
$executionTime = Measure-Command {
#region function InstallWinRMCert
function InstallWinRMCert($serviceName, $vmname)
{
$winRMCert = (Get-AzureVM -ServiceName $serviceName -Name $vmname | select -ExpandProperty vm).DefaultWinRMCertificateThumbprint
$AzureX509cert = Get-AzureCertificate -ServiceName $serviceName -Thumbprint $winRMCert -ThumbprintAlgorithm sha1
@MCKLMT
MCKLMT / CreateANewWebsite.ps1
Last active August 29, 2015 13:56
Gists for a blog post about Windows Azure Powershell command-line tool
# This command retreive the list of all available locations for a website
# Get-AzureWebsiteLocation
# Instanciate a new Website in the choosen Location
$website = New-AzureWebsite -Location "West Europe" -Name "MyNewShinyWebsite"