Skip to content

Instantly share code, notes, and snippets.

Get-AzVM | `
where-object {$_.storageprofile.Osdisk.OSType -eq 'Linux'} | `
ForEach-Object {$out = @()} {$a = [pscustomobject]@{Name = $_.Name; Version = (Get-azVM -status -VMName $_.Name -ResourceGroupName $_.ResourceGroupName).Extensions.Where({$_.Name -match 'OMS'}).TypeHandlerVersion; ResourceGroupName = $_.ResourceGroupName}; $out+=$a}; $out
# Retrieve all Public IPs
$AllPublicIPs = Get-AzureRMPublicIPaddress
# Retrieve all Virtual Networks
$vnetall = Get-AzureRMVirtualNetwork
# Retrieve all Network Interfaces
$nicall = Get-AzureRmNetworkInterface
# Retrieve all ARM Virtual Machines
$AllVMs = Get-AzureRMVM | Sort-object location, resourcegroupname, name
$StatusForAllVms = Get-azureRmVM -Status
{"SchemaVersion":"1.10","RunbookDefinition":"AAEAAAD/////AQAAAAAAAAAMAgAAAGJPcmNoZXN0cmF0b3IuR3JhcGhSdW5ib29rLk1vZGVsLCBWZXJzaW9uPTcuMy4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49MzFiZjM4NTZhZDM2NGUzNQUBAAAALE9yY2hlc3RyYXRvci5HcmFwaFJ1bmJvb2suTW9kZWwuR3JhcGhSdW5ib29rBQAAAApwYXJhbWV0ZXJzCmFjdGl2aXRpZXMFbGlua3MIY29tbWVudHMLb3V0cHV0VHlwZXMDAwMDA7IBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tPcmNoZXN0cmF0b3IuR3JhcGhSdW5ib29rLk1vZGVsLlBhcmFtZXRlciwgT3JjaGVzdHJhdG9yLkdyYXBoUnVuYm9vay5Nb2RlbCwgVmVyc2lvbj03LjMuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPTMxYmYzODU2YWQzNjRlMzVdXbEBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tPcmNoZXN0cmF0b3IuR3JhcGhSdW5ib29rLk1vZGVsLkFjdGl2aXR5LCBPcmNoZXN0cmF0b3IuR3JhcGhSdW5ib29rLk1vZGVsLCBWZXJzaW9uPTcuMy4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49MzFiZjM4NTZhZDM2NGUzNV1drQFTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW09yY2hlc3RyYXRvci5HcmFwaFJ1bmJvb2suTW9kZWwuTGluaywgT3JjaGVzdHJhdG9yLkdyYXBoUnVuYm9vay5Nb2RlbCwgVmVyc2lvbj03LjMuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1Ymx
"groups": "32df13c6-6e25-48e2-9b5e-63dd25f308dd,6a06581b-64b4-4a86-a590-5bb0e1f7a63b,52d47dae-80ce-4e3c-88b5-e1d57e39506e,0c6dbf57-8196-460d-b63b-f55647179c03,4cf3860a-5d4b-4f6f-bec1-bc2bbeec5ec9,a1812dba-2d31-4a1c-9cc2-7091672defc2",
"http://schemas.microsoft.com/identity/claims/identityprovider": "live.com",
"ipaddr": "47.184.55.63",
"name": "Gregory Suvalian",
"http://schemas.microsoft.com/identity/claims/objectidentifier": "6c19805a-8757-42ae-92de-02897cd7ccf9",
"puid": "10037FFE87760F28",
"http://schemas.microsoft.com/identity/claims/scope": "user_impersonation",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier": "w8DgE14xt_N7LiCRKp_5Ib0OQL0G0s1lX6VUEzS95QU",
"http://schemas.microsoft.com/identity/claims/tenantid": "c0de79f3-23e2-4f18-989e-d173e1d403d6",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name": "live.com#artisticcheese@gmail.com",
{
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"resource": {
"properties": {
@artisticcheese
artisticcheese / requestSchema.json
Created February 15, 2019 18:43
RequestSchema
{
"properties": {
"createdDate": {
"type": "string"
},
"detailedMessage": {
"properties": {
"html": {
"type": "string"
},
pool:
vmImage: Hosted VS2017
steps:
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: scripts
TargetFolder: '$(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts@1
PS D:\ntt> $nicInfo.IpConfigurations.Count
2
PS D:\ntt> $nicInfo.IpConfigurations[0]
PrivateIpAddressVersion Name Primary PrivateIpAddress PrivateIpAllocationMethod Subnet Name PublicIpAddress Name ProvisioningState
----------------------- ---- ------- ---------------- ------------------------- ----------- -------------------- -----------------
IPv4 ipconfig1 True 10.233.0.4 Dynamic Succeeded
PS D:\ntt> $nicInfo.IpConfigurations.GetType()
pcb:s:ab1b03c9-6796-480b-9495-421bdfa43d47;EnhancedMode=1
full address:s:localhost
server port:i:2179
negotiate security layer:i:0
EnableCredSspSupport:i:1
allow font smoothing:i:1
allow desktop composition:i:1
audiocapturemode:i:1
audiomode:i:0
authentication level:i:2
PS C:\Windows\system32> get-item "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList\Applications\Windows PowerShell\"
Hive: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList\Applications
Name Property
---- --------
Windows PowerShell Name : Windows PowerShell
Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe