I'm testing the type provider, even though the target machine registers a login and powershell commands I get no errors or return value (result is None). Removed User/Pass/Machine name but checked the values and seem to be ok
#r "System.Management.Automation.dll"
#r "FSharp.Management.PowerShell.dll"
open FSharp.Management
type Ps = PowerShellProvider<"Microsoft.PowerShell.Commands;Microsoft.PowerShell.Core">
let username = """xxx"""
let (password:string) = """xxx"""
let passlistopt = Ps.``ConvertTo-SecureString``(string = password, asPlainText=true, force=true)
let pass = passlistopt.Value.Head
let pscred = new System.Management.Automation.PSCredential(username, pass)
let host = [|"myMachine.myDomain.com"|]
let script = """{Get-Culture}"""
let scriptBlock = System.Management.Automation.ScriptBlock.Create(script)
let result = Ps.``Invoke-Command``(computerName=host,scriptBlock=scriptBlock, credential=pscred)
I'm testing the type provider, even though the target machine registers a login and powershell commands I get no errors or return value (result is None). Removed User/Pass/Machine name but checked the values and seem to be ok