Showing results for July 2006 - Page 2 of 2 - PowerShell Team

Jul 15, 2006
Post comments count1
Post likes count0

Variable expansion in strings and here-strings

PowerShell Team
PowerShell Team

PSMDTAG:FAQ: What is the difference between single quoted and double quoted strings?  ANSWER:  Double quoted string expand variables and single quoted strings do not. Example: PS> $x="TEST"PS> "This is a $x"This is a TESTPS> 'This is a $x'This is a $x   PSMDTAG:FAQ: How do variables expand in strings? PSMDTAG:FAQ: Why don't ...

FAQ
Jul 15, 2006
Post comments count0
Post likes count0

Cascading Type Casts

PowerShell Team
PowerShell Team

A user on the newsgroup wondered whether the example below highlighted a bug or a feature.  They applied multiple type declarations on a single parameter and Windows PowerShell did not complain. function check {   param([string] [int] $y = 0, $x = 0)###^^^^^^^^^^^^  $x.GetType().ToString();  $y.GetType().ToString();  $x + $...

FAQDOTNET
Jul 12, 2006
Post comments count0
Post likes count0

HanselMinutes Podcast on Advanced Windows PowerShell

PowerShell Team
PowerShell Team

Check out Scott Hanselman's podcast on Advanced Windows PowerShell at: http://hanselminutes.com/default.aspx?showID=33 Scott really "gets" PowerShell and has a fantastic way of communicating it.  With V1.0, Windows PowerShell delivers a VERY powerful engine but it gets presented to the world through a command console ...

Podcasts
Jul 12, 2006
Post comments count0
Post likes count0

Indirectly Invoking Methods Via Variablenames

PowerShell Team
PowerShell Team

PSMDTAG:FAQ: Can I specify a methodname using a variable? e.g. $x.$y() PSMDTAG:FAQ: Why do I get METHOD metadata when I specify a method without providing parentheses? One of the great things about Windows PowerShell is that it is a latebound language which allows you to do all sorts of incredibly powerful operations.  Consider the following ...

FAQLANGUAGEMethods
Jul 12, 2006
Post comments count0
Post likes count0

Type Shortcuts

PowerShell Team
PowerShell Team

PSMDTAG:FAQ: What is a TYPE SHORTCUT?PSMDTAG:FAQ: What are the TYPE SHORTCUTS?   Type shortcuts are a Windows PowerShell feature that allows you to reduce the amount of typing you have to do when specifying a type.    For example, the following 2 statements produce the same result: [System.Text.RegularExpressions.Regex]"^c.*" [Regex...

FAQDOTNETLANGUAGE
Jul 7, 2006
Post comments count0
Post likes count0

Are ScriptBlock parameters implemented for functions?

PowerShell Team
PowerShell Team

PSMDTAG:FAQ: Are ScriptBlock parameters implemented for functions? Not in V1.  Functions do not use the same parameter binding mechanism as Cmdlets.  This is something we intent to address in a future release.  -- Jeffrey Snover [MSFT]Windows PowerShell ArchitectMicrosoft CorporationThis posting is provided "AS IS" with no warranties...

FAQ
Jul 6, 2006
Post comments count0
Post likes count0

Revisiting: Listing all the COM automation PROGIDs

PowerShell Team
PowerShell Team

In the blog entry Listing all the COM automation PROGIDs http://blogs.msdn.com/powershell/archive/2006/06/29/650913.aspx . I showed how you could use the registry to get all the progids that you can use for COM automation. Here is a way to do the same thing via WMI (which allows you to do it to remote machines): Get-WMIObject Win32_ProgIDSpeci...

FAQWMICOM
Jul 6, 2006
Post comments count0
Post likes count0

How can a script tell what directory it was run from?

PowerShell Team
PowerShell Team

PSMDTAG:FAQ: How can a script determine what directory it was invoked from?PSMDTAG:FAQ: What is $MyInvocation?PSMDTAG:FAQ: Why is $MyInvocation.ScriptName empty? Create 2 scripts (First.PS1 and Second.PS1) to explore what is going on with $MyInvocation and how you can use it to determine what directory a script was invoked from: PS> cat first.ps...

FAQCMDLET:UTILITY
Jul 4, 2006
Post comments count0
Post likes count0

Use of Preference Variables to control behavior of streams

PowerShell Team
PowerShell Team

PSMDTAG:FAQ: Why don't I see output when I use Write-Verbose and Write-Debug?PSMDTAG:SHELL: Use of Preference Variables to control behavior of streams. In Windows PowerShell, the WRITE-XXX cmdlets merely sends things to a Named stream.  You then have user-defined preferences for what to do when things appear on that stream.  Alex Angelopo...

FAQSHELL
Jul 1, 2006
Post comments count0
Post likes count0

Perserving Command History Across Sessions

PowerShell Team
PowerShell Team

<Edited 7/2/2006 to add tags and Categories> Ben Winzenz didn't like the fact that Windows PowerShell did not maintain history lists between sessions (http://winzenz.blogspot.com/2006/06/cool-mshpowershell-tidbit.html) .   We hear you Ben.  Back to my least favorite phrase, "to ship is to choose".  That said, we try t...

FAQSHELLENVIRONMENT