Open kieranwalsh opened 1 year ago
Hmm, this seems to be a false positive, however I cannot reproduce it, even if I define a Get-OperatingSystem
function or replace OperatingSystem
with a Get-
that I have on my system like ChildItem
This still happens, but for others out there, the simple workaround it:
$Date = (get-date).AddDays(-14)
Get-ADComputer -Properties OperatingSystem, LastLogonTimeStamp -Filter {'OperatingSystem' -like '*Windows*' -and 'LastLogonTimeStamp' -gt $Date}
I keep getting warnings about implicitly aliasing which I feel are incorrect, but perhaps I'm missing something from my code.
Steps to reproduce
Expected behavior
I should get a list of Windows computers with recent logons
Actual behavior
VSCode warns me that:
'OperatingSystem' is implicitly aliasing 'Get-OperatingSystem' because it is missing the 'Get-' prefix. This can introduce possible problems and make scripts hard to maintain. Please consider changing command to its full name.
The auto-formatting then changes my code so my code fails.
Environment data
Outside of adding the data to the whitelist, should I be writing my code differently to avoid this issue?