<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Powershell - Get a list of files &amp;gt; 4GB, all volumes in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Get-a-list-of-files-gt-4GB-all-volumes/m-p/458927#M7030</link>
    <description>&lt;P&gt;I am trying to create a powershell script that will give me a list of every file in our cluster that is greater than 4GB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script must include file path information and output to a .txt file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, I only have the bones of a script and I've been testing it on my work PC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The final version will likely have to be run on the domain controller, but I am not sure how to build the script from the context of the DC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$path = "C:\Users\LJONAH"&lt;BR /&gt;$sizeThreshold = 10&lt;BR /&gt;$outputPath = "C:\temp\OIS_large_files.txt"&lt;BR /&gt;Get-ChildItem -Path $path -Recurse -File -ErrorAction SilentlyContinue |&lt;BR /&gt;Where-Object {$_.Length / 1MB -gt $sizeThreshold}| Select-Object FullName, @{Name="Size GB";Expression={ "{0:N0}" -f ($_.Length / 1GB) }} | Out-File -FilePath $outputPath&lt;/P&gt;</description>
    <pubDate>Wed, 26 Feb 2025 17:51:58 GMT</pubDate>
    <dc:creator>Doc_McJust</dc:creator>
    <dc:date>2025-02-26T17:51:58Z</dc:date>
    <item>
      <title>Powershell - Get a list of files &gt; 4GB, all volumes</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Get-a-list-of-files-gt-4GB-all-volumes/m-p/458927#M7030</link>
      <description>&lt;P&gt;I am trying to create a powershell script that will give me a list of every file in our cluster that is greater than 4GB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script must include file path information and output to a .txt file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, I only have the bones of a script and I've been testing it on my work PC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The final version will likely have to be run on the domain controller, but I am not sure how to build the script from the context of the DC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$path = "C:\Users\LJONAH"&lt;BR /&gt;$sizeThreshold = 10&lt;BR /&gt;$outputPath = "C:\temp\OIS_large_files.txt"&lt;BR /&gt;Get-ChildItem -Path $path -Recurse -File -ErrorAction SilentlyContinue |&lt;BR /&gt;Where-Object {$_.Length / 1MB -gt $sizeThreshold}| Select-Object FullName, @{Name="Size GB";Expression={ "{0:N0}" -f ($_.Length / 1GB) }} | Out-File -FilePath $outputPath&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 17:51:58 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Get-a-list-of-files-gt-4GB-all-volumes/m-p/458927#M7030</guid>
      <dc:creator>Doc_McJust</dc:creator>
      <dc:date>2025-02-26T17:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell - Get a list of files &gt; 4GB, all volumes</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Get-a-list-of-files-gt-4GB-all-volumes/m-p/458981#M7032</link>
      <description>&lt;P&gt;Using the NetApp API:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function Read-NetAppVolDir {
	&amp;lt;#
	.SYNOPSIS
			NetApp Directory Listing

	.Description
			This is a helper script to make reading folder contents in NetApp volumes more intuitive.

	.Outputs
			DataONTAP.C.Types.File.FileInfo
	#&amp;gt;

	param(
			[parameter(mandatory)] [string]$Volume,
			[string[]]$SubFolder,
			[switch]$Recurse
	)

	if ($SubFolder) {
			foreach ($sub in $SubFolder) {
					Get-NcVol $Volume | Get-Ncfile | Foreach-Object {
							"`n    Directory: $($_.Path)/$sub/"
							$files=$_ | Read-NcDirectory ("$($_.Path)"+'/'+$sub)
							if ($Recurse) {
								$files | Where-Object Name -notlike '[.]*'
								$files | Where-Object { $_.Type -eq 'directory' -and $_.Name -notlike '[.]*' } | Foreach-Object {
									Read-NetAppVolDir $Volume "$sub/$($_.Name)" -Recurse
								}
							} else {
								$files
							}
					}
			}
	} else {
			Get-NcVol $Volume | Foreach-Object {
					"`n    Directory: $($_.JunctionPath)/"
					$files=$_ | Read-NcDirectory
					if ($Recurse) {
						$files | Where-Object Name -notlike '[.]*'
						$files | Where-Object { $_.Type -eq 'directory' -and $_.Name -notlike '[.]*' } | Foreach-Object {
							Read-NetAppVolDir $Volume $_.Name -Recurse
						}
					} else {
						$files
					}
			}
	}
}
Get-NcVol | % { Read-NetAppVolDir $_.Name -Recurse } | ? Size -gt 4gb&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 27 Feb 2025 14:55:26 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Get-a-list-of-files-gt-4GB-all-volumes/m-p/458981#M7032</guid>
      <dc:creator>RobDBA</dc:creator>
      <dc:date>2025-02-27T14:55:26Z</dc:date>
    </item>
  </channel>
</rss>

