what does this mean? {$_.S -q } Help with the script
what does this mean? {$_.S -q } I see it all the time in the scripts. For example
-ResultSize unlimited | Where {$_.Subject -eq "System Alert: Sales Database Reaching Capacity"} | Remove-Message -WithNDr $False
I would like to be able to write simple scripts in powershell for Exchange 2010 &2013. Could you please advice on the good resource or videos that I can use.
Quick answer - Think of anything starting with "$_." being an input variable. So if you are pulling in a CSV file to do stuff in powershell, and your CSV looks like:
Name, JobTitle
smithj, manager
williamsa, IT supervisor
johnsonk, engineer
So then to grab the values, you would use "$_.Name" and "$_.JobTitle"
Name, JobTitle
smithj, manager
williamsa, IT supervisor
johnsonk, engineer
So then to grab the values, you would use "$_.Name" and "$_.JobTitle"
"-eq" stands for equal.