Script block as the value of dictionary?
===

Is it possible to implement the following powershell script? I got an error on the script block `{ $doc.getElementsByID("username"]) }`. How to implement closure?


    $ie = New-Object -ComObject "InternetExplorer.Application"
    $ie.navigate($sites[$site]["url"])
    $ie.visible = $true
    while ($ie.busy) { start-sleep -milliseconds 1000; }
    
    $sites = @{
        site1= @{ 
            url = "......."; 
            inputUserID = { $doc.getElementsByID("username"]) }; 
            inputPassword = { $doc.getElementsByName("passowrd"]) }; 
            inputSubmit = "SUBMIT";
            userName = "....";
            password = "...."
        };
        .....
    }