Notes / GCP / Scripts

Scripts

Google Cloud PowerShell scripts for inventory, clean-up, governance, network and data security, and operations, with documentation and safe-use guidance.

Scripts

Every script has built-in help (Get-Help .\Script.ps1 -Full). Reports are read-only; scripts that make changes support -WhatIf.

Inventory and clean-up

Know what you have, and find what you're paying for but not using.

  • Find-GcpOrphanedResources

    Finds orphaned Google Cloud resources that cost money or clutter: unattached disks, unused static IPs, old snapshots and more.

  • Get-GcpVMInventory

    Lists every Compute Engine VM in every project you can see, with machine type, status, IPs, disks, service account and labels.

Governance

IAM hygiene and labelling across every project.

  • Get-GcpIamReport

    Reports risky IAM grants and service account keys in every project: public access, basic roles, outside domains and user-managed keys.

  • Get-GcpUnlabeledResources

    Lists Google Cloud resources that are missing required labels, or have them under a slightly different name.

Network and data security

Open firewall rules and public Cloud Storage buckets.

  • Get-GcpFirewallReport

    Reports VPC firewall rules in every project and flags the risky ones, such as SSH or RDP open to the internet.

  • Get-GcpBucketPublicAccessReport

    Checks every Cloud Storage bucket for public access, and reports public access prevention, uniform access, versioning and soft delete.

Operations

Backup coverage and scheduled start/stop.

  • Get-GcpBackupCoverage

    Shows which Compute Engine VMs and Cloud SQL instances are protected by backups, and which aren't.

  • Invoke-GcpVMPowerSchedule

    Starts or stops Compute Engine VMs that carry a schedule label. Run it on a schedule from Cloud Scheduler, a VM or a pipeline.