#####User details here##### ##Givenergy Portal API Key Goes Below between " " $GivEnergyPortalAPI = "489f53d218f391___OLD_portal_api_key_here_bc6343080b0d1" $InvSN = "SD221_inv_Serial_no_here_" ########end user input############# ##Login to Old API ## $Giv_En = Invoke-WebRequest -Method 'Post' -Uri https://www.givenergy.cloud/GivManage/login/authKey?authKey=$GivEnergyPortalAPI -SessionVariable session $Giv_En.Content | Out-File -FilePath.\Login.txt Write-Output "Login Response Saved to: Login.txt" ##Go Fetch Battery Data## $Giv_En_Bat = Invoke-WebRequest -Method 'Post' -Uri https://www.givenergy.cloud/GivManage/api/pcs/batCell/getBatCellData?serialNum=$InvSN -WebSession $session $Giv_En_Bat.Content | Out-File -FilePath .\BatteryData.txt Write-Output "Data Saved to: BatteryData.txt" Write-Output "All done - Exit in 5...." start-sleep -s 5 Exit