Skip to content

Instantly share code, notes, and snippets.

View phwitservices's full-sized avatar

Peter Walls phwitservices

View GitHub Profile
@Arefu
Arefu / SpiceWorks.ps1
Created December 11, 2018 01:50
SpiceWorks API Access
[CmdletBinding()]
Param(
[string] $url = "http://{SERVER}/pro_users/login",
[string] $username = "{Email}",
[string] $password = '{Password}'
)
$userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0"
$headers = @{"Accept"="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; "Accept-Encoding"="gzip, deflate"; "Accept-Language"="en-US,en;q=0.5";}
$r = Invoke-WebRequest ($url) -SessionVariable session -UserAgent $userAgent -Headers $headers