Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $disks = (GET-WMIOBJECT βquery "SELECT * from win32_logicaldisk where DriveType = '3'").deviceid
- #$Program = Get-ChildItem "C:\Program Files\Microsoft SQL Server" -recurse
- Foreach ($D in $disks) {
- $list = Get-ChildItem | Where-Object { $_.Name -ne "Windows" -and $_.Name -ne "Program Files" -and $_.Name -ne "Program Files (x86)" } | ForEach-Object {get-childitem $_.FullName -include *.mdf -recurse } | select name, length
- }
- foreach ($Item in $List){
- $name = $item.Name
- $length = $item.Length
- write-host "sql-$name-Database $length"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement