Run through PowerShell formatter
This commit is contained in:
parent
90a163007a
commit
3b3918dc22
1 changed files with 23 additions and 21 deletions
|
@ -25,8 +25,9 @@ function Prompt {
|
||||||
}
|
}
|
||||||
|
|
||||||
function ADUserInfo {
|
function ADUserInfo {
|
||||||
Param (
|
param (
|
||||||
[Parameter(Mandatory=$true)] [string]$User
|
[Parameter(Mandatory)]
|
||||||
|
[string]$User
|
||||||
)
|
)
|
||||||
Import-Module ActiveDirectory -ErrorAction Stop
|
Import-Module ActiveDirectory -ErrorAction Stop
|
||||||
$ADPropertiesCommon = @(
|
$ADPropertiesCommon = @(
|
||||||
|
@ -54,7 +55,7 @@ function ADUserInfo {
|
||||||
'msDS-UserPasswordExpiryTimeComputed'
|
'msDS-UserPasswordExpiryTimeComputed'
|
||||||
)
|
)
|
||||||
$ADPropertiesPrintOnly = @(
|
$ADPropertiesPrintOnly = @(
|
||||||
@{Name="PasswordExpiresDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}
|
@{Name = "PasswordExpiresDate"; Expression = { [datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed") } }
|
||||||
)
|
)
|
||||||
$ADPropertiesGet = $ADPropertiesCommon + $ADPropertiesGetOnly
|
$ADPropertiesGet = $ADPropertiesCommon + $ADPropertiesGetOnly
|
||||||
$ADPropertiesPrint = $ADPropertiesCommon + $ADPropertiesPrintOnly
|
$ADPropertiesPrint = $ADPropertiesCommon + $ADPropertiesPrintOnly
|
||||||
|
@ -62,8 +63,9 @@ function ADUserInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
Function mkcd {
|
Function mkcd {
|
||||||
Param (
|
param (
|
||||||
[Parameter(Mandatory=$true,Position=0)] [string]$Path
|
[Parameter(Mandatory)]
|
||||||
|
[string]$Path
|
||||||
)
|
)
|
||||||
New-Item -ItemType Directory -Path $Path
|
New-Item -ItemType Directory -Path $Path
|
||||||
Set-Location -Path $Path
|
Set-Location -Path $Path
|
||||||
|
@ -87,24 +89,24 @@ Set-PSReadLineKeyHandler -Chord Ctrl+RightArrow -Function ForwardWord
|
||||||
Set-PSReadLineKeyHandler -Chord Ctrl+Backspace -Function BackwardKillWord
|
Set-PSReadLineKeyHandler -Chord Ctrl+Backspace -Function BackwardKillWord
|
||||||
Set-PSReadLineKeyHandler -Chord Ctrl+Delete -Function KillWord
|
Set-PSReadLineKeyHandler -Chord Ctrl+Delete -Function KillWord
|
||||||
|
|
||||||
if ($PSVersionTable.PSVersion -ge [System.Version]"7.2") {
|
if ($PSVersionTable.PSVersion -ge [System.Version]"7.2.0.0") {
|
||||||
$AnsiReset = "`e[0m"
|
$AnsiReset = "`e[0m"
|
||||||
Set-PSReadLineOption -Colors @{
|
Set-PSReadLineOption -Colors @{
|
||||||
Default = $AnsiReset;
|
Default = $AnsiReset;
|
||||||
Command = $AnsiReset;
|
Command = $AnsiReset;
|
||||||
Comment = $AnsiReset;
|
Comment = $AnsiReset;
|
||||||
ContinuationPrompt = $AnsiReset;
|
ContinuationPrompt = $AnsiReset;
|
||||||
Emphasis = $AnsiReset;
|
Emphasis = $AnsiReset;
|
||||||
Error = $AnsiReset;
|
Error = $AnsiReset;
|
||||||
InlinePrediction = $AnsiReset;
|
InlinePrediction = $AnsiReset;
|
||||||
Keyword = $AnsiReset;
|
Keyword = $AnsiReset;
|
||||||
Member = $AnsiReset;
|
Member = $AnsiReset;
|
||||||
Number = $AnsiReset;
|
Number = $AnsiReset;
|
||||||
Operator = $AnsiReset;
|
Operator = $AnsiReset;
|
||||||
Parameter = $AnsiReset;
|
Parameter = $AnsiReset;
|
||||||
Selection = $AnsiReset;
|
Selection = $AnsiReset;
|
||||||
String = $AnsiReset;
|
String = $AnsiReset;
|
||||||
Type = $AnsiReset;
|
Type = $AnsiReset;
|
||||||
Variable = $AnsiReset;
|
Variable = $AnsiReset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue