What script should you use?

You have a server named Contoso with multiple databases. You have been tasked to write a PowerShell script to determine which databases on the server are larger than 100GB.
You open PowerShell from SQL Server Management Studio. You create two variables as follows:
PS SQLSERVER:SQLContoso> $MultipleOfGB = 1024 * 1024
PS SQLSERVER:SQLContoso>$Server = Get-Item
You need to determine which script will produce the desired list of databases. What script should you use?
A. $Server | Where-Object{($_.DatabaseSize * $MultipleOfGB) -match 100GB} | Select-Object Name, DatabaseSize
B. $Server.Databases | Where-Object{($_.Size * $MultipleOfGB) -gt 100GB} | Select-Object Name, Size
C. $Server.Databases | Where-Object{($_.Size * $MultipleOfGB) -match 100GB} | Select-Object Name, Size
D. $Server | Where-Object{($_.DatabaseSize * $MultipleOfGB) -gt 100GB} | Select-Object Name, DatabaseSize

microsoft-exams

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.