I hereby claim:
- I am thepvd on github.
- I am thepvd (https://keybase.io/thepvd) on keybase.
- I have a public key ASC33xVVsmgsvoyN0CXxDdF6HsQcYuwkWSZEJLOVUJZU2go
To claim this, I am signing this object:
| const deleteEmptyValues = (body) => { | |
| let obj = {}; | |
| let keys = (bb) => (!Object.keys(bb).length && Object.keys(bb).length !== undefined) | |
| typeof body === 'string' ? body = JSON.parse(body) : null; | |
| for (const key in body) { | |
| let skip = [false]; | |
| if (body.hasOwnProperty(key)) | |
| if ((body[key] !== false && !body[key]) || (body[key].length !== undefined && !body[key].length)) { skip[0] = true; } | |
| else | |
| if (typeof body[key] === 'object') { |
| # stolen from http://woshub.com/powershell-get-folder-sizes/ | |
| gci -force . -ErrorAction SilentlyContinue | ? { $_ -is [io.directoryinfo] } | % { | |
| $len = 0 | |
| gci -recurse -force $_.fullname -ErrorAction SilentlyContinue | % { $len += $_.length } | |
| $_.fullname, '{0:N2} GB' -f ($len / 1Gb) | |
| } |
| #This script will identify a single ephemeral disk presented to windows and format it w/64k blocksize and TEMPORARY label. | |
| #Created by DTH 5/4/20 | |
| #Identify disk with Friendly Name indicating Ephemeral | |
| $disknum = get-disk |where-object {$_.FriendlyName -eq 'NVMe Amazon EC2 NVMe'}| select-object -ExpandProperty Number | |
| #Check to make sure disk is RAW, if so format / label | |
| $operationalstatus = get-disk $disknum | Select-Object -ExpandProperty OperationalStatus | |
| $partitionstyle = get-disk $disknum | Select-Object -ExpandProperty PartitionStyle | |
| if ( $partitionstyle -eq 'RAW' ) { |
| { | |
| "if": { | |
| "allOf": [ | |
| { | |
| "field": "type", | |
| "equals": "Microsoft.Sql/servers/firewallRules" | |
| }, | |
| { | |
| "anyOf": [ | |
| { |
| $clientId = "1950a258-227b-4e31-a9cf-717495945fc2" # This is the standard Client Identifier for Windows Azure PowerShell | |
| $redirectUrl = [System.Uri]"urn:ietf:wg:oauth:2.0:oob" # This is the standard Redirect URI for Windows Azure PowerShell | |
| $tenant = "tenantid.onmicrosoft.com" # Substitute tenant ID here | |
| $resource = "https://management.azure.com"; | |
| $serviceRootURL = "https://graph.windows.net/$tenant" | |
| $authUrl = "https://login.microsoftonline.com/$tenant"; | |
| $postParams = @{resource="$resource";client_id="$clientId"} | |
| $response = Invoke-RestMethod -Method POST -Uri "$authurl/oauth2/devicecode" -Body $postParams | |
| Write-Host $response.message |
I hereby claim:
To claim this, I am signing this object:
| /** | |
| * ps_Nest Thermostat | |
| * | |
| * Copyright 2014 Patrick Stuart | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | |
| * in compliance with the License. You may obtain a copy of the License at: | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * |