This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$DirScripts = "$env:USERPROFILE\OneDrive\PSscripts" | |
. "$DirScripts\profiles\Profile.ps1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Import Credentials | |
$SAMMattAdmin = (Import-Clixml "$DirScripts\Creds\cred_SAM_mattadmin_$Env:ComputerName.xml") | |
$UPNattAdmin = (Import-Clixml "$DirScripts\Creds\cred_UPN_mattadmin_$Env:ComputerName.xml") | |
### Extend the module path to include Onedrive folder | |
$Env:PSModulePath = $Env:PSModulePath -replace 'c:\\Users\\matt\\My Documents\\WindowsPowerShell\\Modules','' | |
$Env:PSModulePath += ";$DirScripts\Modules" | |
### Custom prompt | |
. "$PSScriptRoot\prompt.ps1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-HailStone | |
{ | |
param($n) | |
switch($n) { | |
{$_ -lt 1} {return} | |
1 {$n; return} | |
{$n % 2 -eq 0} {$n; return Get-Hailstone ($n = $n / 2)} | |
{$n % 2 -ne 0} {$n; return Get-Hailstone ($n = ($n * 3) +1)} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<ColorOptions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<ShareFontForConsole>false</ShareFontForConsole> | |
<ScriptPaneFontFamily FontFamilyName="Lucida Console" /> | |
<ScriptPaneFontSize>9</ScriptPaneFontSize> | |
<ConsolePaneFontFamily FontFamilyName="OCR A" /> | |
<ConsolePaneFontSize>9</ConsolePaneFontSize> | |
<ConsolePaneForegroundColor ColorARGB="#8BF5F5F5" /> | |
<ConsolePaneBackgroundColor ColorARGB="#FF012456" /> | |
<ConsolePaneErrorForegroundColor ColorARGB="#FFFF0000" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$OU = Get-ADComputer MattsPC | | |
Select-Object @{ | |
n='ParentContainer' | |
e={$_.distinguishedname -replace "CN=$($_.cn),"} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
$Variables = Get-Variable -Scope Global -ErrorAction Stop | |
foreach ($Variable in $Variables) | |
{ | |
$VarName = $Variable.Name | |
$Value = Invoke-Expression "`$$VarName" | |
$TypeName = $Value.PSObject.TypeNames[0] | |
if ($TypeName -eq 'My.Type') {$Value} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<ColorOptions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<ShareFontForConsole>false</ShareFontForConsole> | |
<ScriptPaneFontFamily>Lucida Console</ScriptPaneFontFamily> | |
<ScriptPaneFontSize>9</ScriptPaneFontSize> | |
<ConsolePaneFontFamily>Consolas</ConsolePaneFontFamily> | |
<ConsolePaneFontSize>10</ConsolePaneFontSize> | |
<ConsolePaneForegroundColor>#FFEEEEEC</ConsolePaneForegroundColor> | |
<ConsolePaneBackgroundColor>#FF2E3436</ConsolePaneBackgroundColor> | |
<ConsolePaneErrorForegroundColor>#FFEF2929</ConsolePaneErrorForegroundColor> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$SB = { | |
$Command = Get-Command -Name $args[1] | |
Get-Module -Name $Command.ModuleName | | |
Format-List Name, Description, Version, PowerShellHostName, | |
PowerShellVersion, Author, CompanyName | |
} | |
Add-SteroidsContextMenuCommand -DisplayName 'Get Parent Module' -TokenType Command -ScriptBlock $SB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-Mailbox -Filter * -ResultSize Unlimited | Foreach { | |
$DN = $_.DistinguishedName | |
$Status = Get-Clutter -Identity $DN | Select -ExpandProperty isEnabled | |
if (!$Status) | |
{ | |
Set-Clutter -Identity $DN -Enable $false | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Styles version="1" FontName="Lucida Console" FontSize="10" BackColor="FFFDF6E3" MarginColor="FFF0F0F0"> | |
<Style name="Text" Bold="False" Italic="False" Underline="False" ForeColor="FF268BD2" BackColor="FFFDF6E3" /> | |
<Style name="Cmdlet" Bold="False" Italic="False" Underline="False" ForeColor="FF586E75" BackColor="FFFDF6E3" /> | |
<Style name="Alias" Bold="True" Italic="False" Underline="False" ForeColor="FF0000FF" BackColor="0" /> | |
<Style name="Reserved Word" Bold="False" Italic="False" Underline="False" ForeColor="FF859900" BackColor="FFFDF6E3" /> | |
<Style name="Operator" Bold="False" Italic="False" Underline="False" ForeColor="FF93A1A1" BackColor="FFFDF6E3" /> | |
<Style name="Variable" Bold="False" Italic="False" Underline="False" ForeColor="FFCB4B16" BackColor="FFFDF6E3" /> | |
<Style name="Number" Bold="False" Italic="False" Underline="False" ForeColor="FF2AA198" BackColor="FFFDF6E3" /> | |
<Style name="String" Bold="False" Italic="False" Underline="False" ForeColor="FF2AA198" BackColor="FFFDF6E3" /> | |
<Styl |