@Sebastian-Roth said in API - Create Host Deploy Task "error": "Invalid tasking type passed":
@Jamaal From the error message I would imagine that this last call is failing because an earlier query also failed and variables are not being set correctly because of the earlier error. So you need to post the full error you see!
I am not a PowerShell wiz but from what I know the read-host stuff you added should work.
Thanks man, you pointed me in the right direction.
So I went back to your script again and ran it and noticed it kept giving an error message after the 1st throw command, like Powershell was skipping the 2nd and 3rd throw command.
What I had to do was do a read-host, but kept the $ (read-host “enter machine name”) for example:
[String] $MachineName = $( read-host “Provide the target machines Name”),
[String] $MacAddress = $(Read-Host “Provide the target machine Address”),
[String] $ImageName = $(read-host “Provide the Image Name to assign to the new target host”)
So I saw the task in the task list right away. I’m so so with powershell and starting to get better with it, you know. What I would like to do is maybe figure out powershell commands to add the snapins as a read-host so the tech can select which snapins to use instead of going to the Fog console to be more automatic.
And I would like Powershell to start the task once the hostname is added to Fog. I can start playing around that.