Posts

Showing posts from August, 2018

PowerShell: How can I list/document all the items in my azure subscription?

The following script will create an Excel file with each Resource Group as a tab. First, I created a password file to reference from the script (no passwords in clear text please) "xxxx" | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString | Out-File "C:\Temp\Password.txt"  Here is the function - it will create seperate CSV files per resource group and then merge them intoa a single Excel file at the end. BTW, you may want to change the hard coded directories, username and filenames as required..... enjoy # create a function to merge the csv files we have created Function Merge-CSVFiles  {                  Param(                                  $CSVPath = "C:\csv\", ## Soruce CSV Folder                                  $XLOutput="c:\Temp\csv\data.xlsx" ## Output file name                  )                     $csvFiles = Get-ChildItem ("$CSVPath\*") -Include *.csv