Skip to content

Instantly share code, notes, and snippets.

View tomtorggler's full-sized avatar
😁
gruntled

Thomas Torggler tomtorggler

😁
gruntled
View GitHub Profile
function Set-VmNestedHVStatus {
param($VM,[bool]$NestedHVStatus)
foreach ($item in $VM) {
try {
$vm = Get-VM $item
$spec = New-Object -TypeName VMware.Vim.VirtualMachineConfigSpec
$spec.ChangeVersion = $vm.ExtensionData.Config.ChangeVersion
$spec.NestedHVEnabled = $NestedHVStatus
$vm.ExtensionData.ReconfigVM($spec)
} catch {

Keybase proof

I hereby claim:

  • I am tomtorggler on github.
  • I am tomt (https://keybase.io/tomt) on keybase.
  • I have a public key ASDkspxaIxbg8tpKYocXMOINXISsNHKy95ujOT-fqEAtXwo

To claim this, I am signing this object:

@tomtorggler
tomtorggler / api-posts.html
Created March 31, 2017 15:56
Create JSON objects for all posts on a Jekyll site
---
# Requires Front Matter
---
{"items":[{% for post in site.posts %}{
"title": {{post.title | jsonify}},
"url": {{ post.url | prepend: site.baseurl | prepend: site.url | jsonify }},
"date": {{ post.date | date: '%B %-d, %Y' | jsonify }},
"category": {{ post.category | jsonify }},
"tags": {{ post.tags | jsonify }},
"author": {{ post.author | jsonify }},
# check if a new release of PowerShell Core is available on GitHub
function Test-PSVersionGitHub {
try {
# get latest release from github atom feed
$Release = Invoke-RestMethod https://github.com/PowerShell/PowerShell/releases.atom -ErrorAction Stop | Select-Object -First 1
} catch {
Write-Warning "Could not check for new version. $_ `n"
break
}
# extract information from atom response
@tomtorggler
tomtorggler / Add-ExchangeOnlineAlias.ps1
Last active July 16, 2018 07:39
Adds Exchange Online email address to Mailboxes
if(-not(Get-PSSession)) {
. 'D:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'
Connect-ExchangeServer -auto -ClientApplication:ManagementShell
}
$Mailboxes = Get-Content .\shared.txt | Get-Mailbox
$ExOSuffix = "<tenant>.mail.onmicrosoft.com"