Skip to content

Instantly share code, notes, and snippets.

@doctordns
Last active February 22, 2022 06:13
Show Gist options
  • Save doctordns/4d0acab299b572ea7902431f8a182253 to your computer and use it in GitHub Desktop.
Save doctordns/4d0acab299b572ea7902431f8a182253 to your computer and use it in GitHub Desktop.
# Sample PowerShell 7 Profile File
# Copy the contents of this GIST to $Profile
# Meant to be a starting point.
# Greet the usser
"In Customiaations for: [$($Host.Name)]"
"For : [$(whomi)]"
"On ; [$(hostname)]"
# Set Me
$me = whoami
# Set Format enum limit
$FormatEnumerationLimit = 99
# Set some command Defaults
$PSDefaultParameterValues = @{
"*:autosize" = $true
'Receive-Job:keep' = $true
'*:Wrap' = $true
}
# Set home to C:\Foo for ~, then go there
New-Item C:\Foo -ItemType Directory -Force -EA 0 | Out-Null
$Provider = Get-PSProvider Filesystem
$Provider.Home = 'C:\Foo'
Set-Location ~
Write-Host 'Set ~ to C:\Foo'
# Define a useful Get-HelpDetailed
Function Get-HelpDetailed {
Get-Help $args[0] -detailed
} #END GHD Function
# Set aliases
Set-Alias gh Get-Help
Set-Alias ghd Get-HelpDetailed
# Create Reskit Credential
$Urk = 'Reskit\Administrator'
$Prk = ConvertTo-SecureString 'Pa$$w0rd' -AsPlainText -Force
$Credrk = New-Object system.management.automation.PSCredential $Urk, $Prk
"`$Credrk created for $($credrk.username)"
Write-Host "Completed Customisations to $(hostname)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment