Home > Blockchain >  Schedule report every month on 28th append with month and year name by PowerShell Script
Schedule report every month on 28th append with month and year name by PowerShell Script

Time:10-03

if((Get-date).day -eq 28) {
Set-AzStorageBlobContent -Container "azurepolicies" -File "subcriptions|"$month"|"year".csv" -Content $storage.Content -Force
}

Error:

| A positional parameter cannot be found that accepts argument 
| 'year.csv'.

CodePudding user response:

I checked the Set-AzStorageBlobContent

    # Hopefully this will lead in you the right direction.  
    $Today = Get-Date
    if ($Today.day -eq 28) { 
        Set-AzStorageBlobContent `
        -Container "azurepolicies" `
        -File ("subscriptions{0}{1}.csv" -f $Today.Month, $Today.Year) `
        -Content $storage.Content -Force 
    }
  • Related