Sign in
|
Join PowerShell.com!
|
Help
Home
PowerTips
Ask the Experts
Forums
Webcasts
Blogs
eBookV2
Script Library
Twitter Grid
Modules
QuickClick
Scripts
Snippets
Videos
Library
»
Snippet Library
»
Functions
»
Slideshow
Functions Slideshow
Share
|
Browse Library
Module Library
QuickClick Library
Script Library
Snippet Library
ADSI
Comparison
Conditions and Loops
.Net
Exception Handlers
Files and Folders
Functions
Headers
Includes
Network
Pipeline
PowerShell Internals
Registry
Samples
Script Functions Templates
Security
SQL Server
Templates
User Management
WMI
Video Library
Members Only
Tags
Function
Prompt Advanced
Prompt Computer
Snippet
View more
Prompt with history count and console title
<?
xml
version
=
"1.0"
?>
<CodeSnippets xmlns
=
"http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"
>
<CodeSnippet Format
=
"1.0.0"
>
<Header>
<Title>Prompt with history count and console title<
/
Title>
<Shortcut
/
>
<Description>Replaces the prompt with the current command history id and displays the current path
in
the console title bar<
/
Description>
<Author>Dr. Tobias Weltner http:
//
www.powershell.de
<
/
Author>
<SnippetTypes>
<SnippetType>Expansion<
/
SnippetType>
<
/
SnippetTypes>
<
/
Header>
<Snippet>
<Code Language
=
"PowerShell"
Kind
=
"5"
><
!
[CDATA[
function
prompt {
Write-Prompt
((
Get-History
-Count
1).
Id
+
1)
$Host
.
UI.RawUI.WindowTitle
=
get-location
return
' '
}]]><
/
Code>
<
/
Snippet>
<
/
CodeSnippet>
<
/
CodeSnippets>
Loading...
Prompt with...
Prompt Computer
Simple Function
View all files
Copyright 2011 PowerShell.com. All rights reserved.