Skip to content

Instantly share code, notes, and snippets.

View crshnbrn66's full-sized avatar

Thom Schumacher crshnbrn66

View GitHub Profile
@crshnbrn66
crshnbrn66 / CreateProfile.ps1
Last active March 24, 2017 22:09 — forked from adamdriscoll/CreateProfile.ps1
Create profile
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 / Compare-ObjectEquivalence.ps1
Created June 6, 2017 17:21 — forked from KirkMunro/Compare-ObjectEquivalence.ps1
A function that facilitates comparison of serialized objects with their deserialized or selected equivalent
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 / Invoke-RestSPO.ps1
Last active July 3, 2018 19:13 — forked from vgrem/Invoke-RestSPO.ps1
SharePoint Online REST request
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/
@crshnbrn66
crshnbrn66 / cortex.sh
Created September 21, 2023 17:33 — forked from szampardi/cortex.sh
use a json file for shell vars
#!/usr/bin/env bash
CORTEX_CRYPTO="aes-256-cbc"
_cortex_logger() { printf '{%s}[%s](%s):%s\t%s\n' "$(date -u '+%FT%TZ')" "${1}" "$(caller)" "${2}" "${@:3}" 1>&2; }
_cortex_io() {
case "${CORTEX_FILE}" in
"") _cortex_logger "$(caller)" ERR "CORTEX_FILE environment variable is empty/unset" && return 127 ;;
*)
@crshnbrn66
crshnbrn66 / user-profile.psm1
Last active December 19, 2023 17:53 — forked from MSAdministrator/Create-NewProfile.ps1
PowerShell functions to create a new user profile
<#
.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)