Next I had to fix a corruption caused by the entry relating to the 2.5″ drives (the escaping of the double quote wasn’t working), and then HTML decode the text and convert from JSON to a PowerShell object. Next I found that with the UserAgent field left as default, the request was being intercepted by the outbound proxy, fortunately Invoke-WebRequest allows you to spoof the UserAgent, enabling the page to be retrieved.Īfter a few abortive attempts, I discovered that there is a field used by the “Export to csv” function in the web page which appears to contain the hardware inventory in an html encoded JSON string.įirstly I had to string this specific line out of the raw HTML, then strip the data out of the HTML code. In turn I quickly discovered that I couldn’t use the more useful HTML parsing methods as they utilise the Internet Explorer engine. The first hurdle was the I could only run the PowerShell from my Mac, so that meant using PowerShell Core. I had a list of servers that were available for re-use, with serial numbers, but no hardware specs, so decided to download the specifications to decide whether any of them would be suitable for my requirement. This is displayed in a series of expandable sections, but with an option to export to csv. The Dell Support web page allows you to submit a server tag, and view the original configuration for the server when it was delivered. This would probably have taken less time if I’d just input each tag to the website and done “Export to csv” however I hate repetitive tasks and thought I’d be able to reuse some existing PowerShell scripting that does HTML mechanisation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |