![]() ![]() To remove the files en masse, you can then use the following commands: Get-ChildItem -path $path -recurse -include $Extension | where-Object #script to find out the files based on the above input #Find out the files greater than equal to below mentioned size Thanks a lot for good script, but it cuts long names and paths and I decided to little correct it and provide my version to resolve this issue: Or if you like you file sizes formatted with thousands separators: Invoke-Sqlcmd -ServerInstance servername -Query "SELECT physical_name, sizeMB = CONVERT(VARCHAR, CAST(size / 128.0 AS MONEY), 1) FROM sys.master_files ORDER BY size DESC" Invoke-Sqlcmd -ServerInstance servername -Query "SELECT physical_name, sizeMB = size / 128.0 FROM sys.master_files ORDER BY size DESC" This won't tell you anything about any other large files on the server, but it's easier to run remotely. ![]() ![]() An alternative would be to query the master_files table to get the sizes of all active files. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |