![]() One remark: Instead of using "-include", I'd use "-filter". Hi Jugal, I am following most of your posts, they are effective and helping me in my day to day work. Monday, Septem9:52:13 AM - Satheesh Kumar Thanks so much! Just used this today on a couple of servers that were virtual machines with small C: drives that were running out of space. Monday, Septem10:44:05 PM - Hassan Parthasarathy ![]() + FullyQualifiedErrorId : RuntimeExceptionīy using the below statement I have executed the script : + CategoryInfo : NotSpecified: (:), PSSecurityException Shows the following error:įile E:\Srpt.ps1 cannot be loaded because the execution of scripts is disabled on this system. Powershell was not allowing to run the script. Thanks a lot, saved my time.Īlso would like to highlight the problem I faced while executing the script. You can also try option in this kind of issue. ![]() It is useful to use the Export-Csv cmdlet here to output the details of all objects found to a CSV file for opening in ExcelĬool. 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. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |