# export-csv help

**URL:** <https://forums.powershell.org/t/export-csv-help/11928>\
**Category:** PowerShell Help\
**Created:** [January 18, 2019, 1:00pm UTC](https://forums.powershell.org/t/export-csv-help/11928 "2019-01-18T13:00:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![soma-sympli](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@soma-sympli](https://forums.powershell.org/u/soma-sympli)\
**Post date:** [January 18, 2019, 1:00pm UTC](https://forums.powershell.org/t/export-csv-help/11928/1 "2019-01-18T13:00:34Z")

</div>

Hi Guys,

&nbsp;

is there a way to export output from below script into excel, subscription wise ? or diff excels for each subscription ?

&nbsp;

```auto
$resources = Get-AzureRmResource
foreach($resource in $resources)
{
    if ($resource.Tags -eq $null)
    {
        echo $resource.Name, $resource.ResourceType
    }
}

```

---

<div class="post-metadata">

**Author:** ![rob-simmers](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/rob-simmers/32/1010_2.png) [@rob-simmers](https://forums.powershell.org/u/rob-simmers)\
**Post date:** [January 18, 2019, 5:30pm UTC](https://forums.powershell.org/t/export-csv-help/11928/2 "2019-01-18T17:30:03Z")

</div>

Try something like this:

```
Get-AzureRmResource | #Return all Resources (if you can filter tags here, it is better)
Where-Object -FilterScript {!($_.Tags)} | #if you can't filter at the command, you can filter with Where-Object, ! or -not NULL, which translates to IS NULL
Select-Object -Property Name, Resource | # Get the properties you care about
Export-CSV -Path C:\AzureResource.csv -NoTypeInformation #Export to a CSV
```

---

<div class="post-metadata">

**Author:** ![kpatnayakuni](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/kpatnayakuni/32/19_2.png) [@kpatnayakuni](https://forums.powershell.org/u/kpatnayakuni)\
**Post date:** [January 18, 2019, 7:21pm UTC](https://forums.powershell.org/t/export-csv-help/11928/3 "2019-01-18T19:21:37Z")

</div>

[pre]

Install-Module ImportExcel # Install the module from PSGallery

Import-Module ImportExcel # Import the module

Import-Module Az # Import the new Azure PowerShell module 'Az' (https://docs.microsoft.com/en-us/powershell/azure/new-azureps-module-az?view=azps-1.1.0)

Get-AzResource|Where-Object-FilterScript {!($\_.Tags)} |Select-Object-Property Name, Resource |Export-Excel

# There are vast variety of options with Export-Excel, please explore. (Get-Help Export-Excel -Full)

[/pre]

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:34pm UTC](https://forums.powershell.org/t/export-csv-help/11928/4 "2024-05-16T20:34:05Z")

</div>


