Created
March 4, 2016 15:53
-
-
Save itpropro/e2074e84eef3ff317739 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$message = "The size of your desktop folder exceeds 500MB.`r`nThis can cause delays at logon and logoff.`r`n`r`nGreetings from your IT-Department" | |
if ([Math]::Truncate((Get-ChildItem "$env:USERPROFILE\Desktop" -Recurse|Measure-Object -property Length -sum).Sum / 1MB) -gt 500){[System.Windows.Forms.MessageBox]::Show($message)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment