Skip to content

Instantly share code, notes, and snippets.

View DWSR's full-sized avatar

Brandon McNama DWSR

  • Ford Motor Company
  • Toronto, Ontario, Canada
  • 08:56 (UTC -04:00)
View GitHub Profile
$jsonObject = @{
TERMID = 3232
PINSERV = '192.168.1.52:5145'
MERCHANTID = 01
ID = 1421336011
Serv = '192.168.1.180:5150'
Lane = 2017
} | ConvertTo-Json
$TestDir = 'path/filename.xml';
$jsonObject = @{
TERMID = 3232
PINSERV = '192.168.1.52:5145'
MERCHANTID = 01
ID = 1421336011
Serv = '192.168.1.180:5150'
Lane = 2017
} | ConvertTo-Json
@DWSR
DWSR / Get-MemberOfDistributionGroup.ps1
Created November 21, 2015 22:09
Function to get which distribution groups someone is a member of.
function Get-MemberOfDistributionGroups
{
[CmdletBinding()]
Param(
[String]$Identity
)
$user = Get-Mailbox $Identity
"$($user.DisplayName) is a member of the following groups:"
foreach ($Group in (Get-Recipient -Filter "Members -eq '$($user.DistinguishedName)'"))
{
@DWSR
DWSR / Invoke-Webrequest.ps1
Last active November 13, 2015 16:25 — forked from riahc3/Invoke-Webrequest.ps1
Invoke-Webrequest
# establish initial connection to website
$initialRequest = Invoke-WebRequest -Uri 'http://192.168.100.97/csl/login' -SessionVariable WebSession1
#$initialrequest is now an object containing the html of the web request. get the form elements from the page
$form = $initialRequest.Forms[0] #outputting $form.fields to the screen will show you all the elements. Assuming 'username' and 'password'...
# update $form with username and password info and submit this back to the login webpage as POST
$form.fields.userpwd = "PASS"
$form.fields.username = "USER"
@DWSR
DWSR / VIobject
Last active November 6, 2015 13:59 — forked from biacz/.ps1
i am interested in $_.summary.config.NumCPU and $_.summary.config.MemorySizeMB
----------
Capability : VMware.Vim.VirtualMachineCapability
Config : VMware.Vim.VirtualMachineConfigInfo
Layout : VMware.Vim.VirtualMachineFileLayout
LayoutEx : VMware.Vim.VirtualMachineFileLayoutEx
Storage : VMware.Vim.VirtualMachineStorageInfo
EnvironmentBrowser : EnvironmentBrowser-envbrowser-1905