Skip to content

Instantly share code, notes, and snippets.

View exactmike's full-sized avatar

Mike Campbell exactmike

View GitHub Profile
@exactmike
exactmike / SharedFunctions.ps1
Created August 1, 2018 16:21
Exchange Recipient Extract via AD Function
function Get-AllADRecipientObjects
{
[cmdletbinding()]
param
(
[Parameter()]
[AllowNull()]
[int]$ResultSetSize = $null
,
[string[]]$ADUserAttributes
@exactmike
exactmike / RegisterArgumentCompleterExamples.ps1
Created April 27, 2018 15:11
Register-ArgumentCompleter Examples
Register-ArgumentCompleter -CommandName @(
'Set-OneShellUserProfileSystem'
'Get-OneShellUserProfileSystem'
) -ParameterName 'Identity' -ScriptBlock {
param($commandName, $parameterName, $WordToComplete, $commandAst, $fakeBoundParameter)
$OrgProfilePath = if ($null -eq $fakeBoundParameter.OrgProfilePath) {$script:OneShellOrgProfilePath} else {$fakeBoundParameter.OrgProfilePath}
$Path = if ($null -eq $fakeBoundParameter.Path) {$Script:OneShellUserProfilePath} else {$fakeBoundParameter.Path}
$GetOneShellUserProfileSystemParams = @{
Path = $Path
OrgProfilePath = $OrgProfilePath
@exactmike
exactmike / TestFunctions.ps1
Last active January 18, 2018 17:13
Some Shared Powershell Test Functions
function Test-TCPConnection
{
<#
.SYNOPSIS
Tests a TCP Connection to each port specified for each ComputerName specified.
.DESCRIPTION
Tests a TCP Connection to each port specified for each ComputerName specified and,
if specified, can return details for each requested ComputerName and port.