Link to home
Create AccountLog in
Avatar of Kelly Garcia
Kelly GarciaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Powershell Code

Hi All,

I am trying to understand this line of code

function ScreenPassword($instance)  
{  
    if (!($instance.screensaversecure)) {return $instance.name}   
    <additional statements>  
}  

foreach ($a in @(get-wmiobject win32_desktop)) { ScreenPassword($a) }

Open in new window


what is the function of the @ symbol in @(get-wmiobject win32_desktop) ??

thank you in advance
Avatar of aikimark
aikimark
Flag of United States of America image

It casts the result of the get-wmiobject result as an array/list
ASKER CERTIFIED SOLUTION
Avatar of footech
footech
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
@Kay

Did you mean to accept the footech comment as the solution?  You have endorsed my comment.
Avatar of Kelly Garcia

ASKER

yes, as footech gave the best answer, hope this is ok??