Skip to content

Instantly share code, notes, and snippets.

@crshnbrn66
crshnbrn66 / Compare-ObjectEquivalence.ps1
Created Jun 6, 2017 — forked from KirkMunro/Compare-ObjectEquivalence.ps1
A function that facilitates comparison of serialized objects with their deserialized or selected equivalent
View Compare-ObjectEquivalence.ps1
function Compare-ObjectEquivalence {
[CmdletBinding(DefaultParameterSetName='Deserialized')]
param(
[Parameter(Position=0, Mandatory=$true)]
[ValidateNotNull()]
[System.Object]
$OriginalObject,
[Parameter(Position=1, Mandatory=$true, ParameterSetName='Deserialized')]
[ValidateNotNull()]
@crshnbrn66
crshnbrn66 / user-profile.psm1
Last active Sep 24, 2021 — forked from MSAdministrator/Create-NewProfile.ps1
PowerShell functions to create a new user profile
View user-profile.psm1
<#
.Synopsis
Rough PS functions to create new user profiles
.DESCRIPTION
Call the Create-NewProfile function directly to create a new profile
.EXAMPLE
Create-NewProfile -Username 'testUser1' -Password 'testUser1'
.NOTES
Created by: Josh Rickard (@MS_dministrator) and Thom Schumacher (@driberif)
View CreateProfile.ps1
function CreateProfile
{
param([String]$UserSid, [String]$UserName, [system.uint32]$ProfilePath)
Add-Type -TypeDefinition '
using System;
using System.Runtime.InteropServices;
public static class PInvoke {
[DllImport("userenv.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern int CreateProfile( [MarshalAs(UnmanagedType.LPWStr)] String pszUserSid, [MarshalAs(UnmanagedType.LPWStr)] String pszUserName, [Out, MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder pszProfilePath, uint cchProfilePath);
}
@crshnbrn66
crshnbrn66 / Invoke-RestSPO.ps1
Last active Jul 3, 2018 — forked from vgrem/Invoke-RestSPO.ps1
SharePoint Online REST request
View Invoke-RestSPO.ps1
Add-Type –Path 'C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll'
Add-Type –Path 'C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll'
#http://www.codeproject.com/Articles/990131/CRUD-Operation-to-List-Using-SharePoint-Rest-API
#https://msdn.microsoft.com/en-us/library/office/fp142380.
#http://paulryan.com.au/2013/odata-in-sharepoint/
#https://wmostafaw.wordpress.com/2012/11/17/odata-in-sharepoint-2013-lists-and-items/
#http://blogs.msdn.com/b/uksharepoint/archive/2013/02/22/manipulating-list-items-in-sharepoint-hosted-apps-using-the-rest-api.aspx
#http://www.odata.org/getting-started/basic-tutorial/