So I've watched and re-watched Episode 86 - Intro to Powershell and Orion API - by @KMSigma.SWI and whilst some light is starting to become apparent, I'm still very much clueless.
So, I have managed to create my Credentials and my Connection, and furrther, I have tested these as working.
Originally, I tried to copy exactly what Kevin was doing in the video but kept getting an error stating that the 'from keyword' was not supported, but it clearly was as Kevin was running it just fine. I read and re-read my code but couldn't see what was wrong and so in the end just went with a very basic query.
$SwqlQuery = "
SELECT TOP 10 Caption
FROM Orion.Nodes"
Which worked - but not very useful for anything, other than for me to start to get to grips with this. So, my first (self) challenge was to get it so I could see what this output is, but for the life of me I can't workout:
- How do I view the resultant output on the screen? ...or
- How do I view that same output, but exported to a file (for example)
- though I did find 'Out-File' cmdlet and used: Out-File -FilePath d:\test.txt but the file itself was empty.
The next query is to try and understand a part of the code Kevin had... at 42m in, the code shows: $SwqlQuery = @ code snippet @ but I'm missing the understanding of the @';s in the code.
I may be trying to run here before I can walk so I am also off to do some more reading, if I can find something appropriate to link together the use of the Swis stuff with Powershell.