Jump to content

PowerShell mit angepasster Profil.ps1


Der letzte Beitrag zu diesem Thema ist mehr als 180 Tage alt. Bitte erstelle einen neuen Beitrag zu Deiner Anfrage!

Recommended Posts

Hallo zusammen,

 

ich habe für mein PowerShell nun eine eigene Profil.ps1 angelegt.

Diese wird auch geladen.

 

Leider funktioniert nun die Eigenschaft -detailed nicht mehr:

man get-childitem -detailed

help get-childitem -detailed

 

Hier wird nun nur noch die kurze Übersicht angezeigt.

Get-Help het-childitem -detailed

funktioniet aber korrekt!

 

Hat hierzu jemand einen Rat?

 

Wenn keine custom Profil.ps1 lade, funktioniert es wieder :-)

 

Set-Location C:\

function help
{
   get-help $args[0] | out-host -paging
}

function man
{
   get-help $args[0] | out-host -paging
}

function mkdir
{
   new-item -type directory -path $args
}

function md
{
   new-item -type directory -path $args
}

function prompt
{
$(Write-Host "PS" $(get-date -format g) -nonewline -foregroundcolor Green) + " " + $(get-location) + "> "
return " "
}

& {
   for ($i = 0; $i -lt 26; $i++) 
   { 
       $funcname = ([system.Char]($i+65)) + ':'
       $str = "function global:$funcname { set-location $funcname } " 
       invoke-expression $str 
   }
}

 

Schöne Grüße

 

Jens

Link to comment
Der letzte Beitrag zu diesem Thema ist mehr als 180 Tage alt. Bitte erstelle einen neuen Beitrag zu Deiner Anfrage!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...