hello again,
I am working on a script to remove some out of date / unused user profiles from a system the script I am trying to get the work is:
$profile = get-childitem -path c:\users -name old | where {((get-date)-$_.lastwritetime).Days-ge 90}
foreach(P in $profile) {write-output $P “Found”
how ever I am having an issue
issue 1
unless I put in the exact file name it will give an error "can not find overload for “op_subtraction” and the argument count: “2” - from what I can tell this is because ti is not returning results but I know for a fact there is at least one valid result. I have tried with old *old old “old” and ‘old’ and get no results but if I put in the full name of the folder it returns a result
I have seen examples like this before so I am kind of confused as to what I am doing wrong
BTW I am using PS 2.0