-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathlist-gce.ps1
31 lines (29 loc) · 944 Bytes
/
list-gce.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# This script is a simple menu for listing resources in Google Cloud Platform. In order for this script to work, you must have the GoogleCloud and the SimpleMenu modules installed.
$items = @()
# List VM instances
$gceinstance = New-SMMenuItem -Title "Instances" -Action {
Get-GceInstance | Format-Table
}
$items += $gceinstance
# List VM snapshots
$gcesnapshot = New-SMMenuItem -Title "Snapshots" -Action {
Get-GceSnapshot | Format-Table
}
$items += $gcesnapshot
# List buckets
$gcsbucket = New-SMMenuItem -Title "Buckets" -Action {
Get-GcsBucket | Format-Table
}
$items += $gcsbucket
# List VM disks
$gcedisk = New-SMMenuItem -Title "Disks" -Action {
Get-GceDisk | Format-Table
}
$items += $gcedisk
# List networks
$gcenetwork = New-SMMenuItem -Title "Networks" -Action {
Get-GceNetwork | Format-Table
}
$items += $gcenetwork
$menu = New-SMMenu -Title "Google Cloud Resources" -Items $items
Invoke-SMMenu -Menu $menu