Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

what is wrong with this code?

$
0
0

I am using the Quest AD tools.   I loaded them up before I ran this code.

function inactive_computers()
{
    Set-QADPSSnapinSettings -DefaultSizeLimit 0
    $old = (Get.Date).AddDays(-50)
    Get-QADComputer -IncludedProperties pwdLastSet -SizeLimit 10 | where {$_.pwdLastSet -le $old}

    }

    inactive_computers | Sort-Object -property 'Name'

-----------------------------------------------------------------------------------------------------

When I run this code I get this error.

Get.Date : The term 'Get.Date' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of 
the name, or if a path was included, verify that the path is correct and try again.

But the Get-Date looks fine when I compare it against code I've found online.  


mqh7


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>