Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

parameter abbreviation

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-17-2007   #1 (permalink)
$hay
Guest


 

parameter abbreviation

can parameters be abbreviated?

like shortening SilentlyContinue into something like sc???

--
$hay
http://scriptolog.blogspot.com





My System SpecsSystem Spec
Old 01-17-2007   #2 (permalink)
Brandon Shell
Guest


 

Re: parameter abbreviation

My understanding from when this was discussed before is that switches can be
abbreviated, but not the values.

i.e. copy-item -path c:\myfile.txt -dest d:\myfile.txt

so... in your case... SilentlyContinue is a value... so I dont think you
can.

--

Brandon Shell
---------------
Stop by my blog some time
http://mybsinfo.blogspot.com/
----------------------------------

"$hay" <no@addre.ss> wrote in message
news:%23JURIjnOHHA.3268@TK2MSFTNGP03.phx.gbl...
> can parameters be abbreviated?
>
> like shortening SilentlyContinue into something like sc???
>
> --
> $hay
> http://scriptolog.blogspot.com
>
>
>
>


My System SpecsSystem Spec
Old 01-17-2007   #3 (permalink)
Keith Hill [MVP]
Guest


 

Re: parameter abbreviation

"$hay" <no@addre.ss> wrote in message
news:%23JURIjnOHHA.3268@TK2MSFTNGP03.phx.gbl...
> can parameters be abbreviated?
>
> like shortening SilentlyContinue into something like sc???


I've disliked SilentlyContinue from the get go. It is just too darn long to
type. At one time I proposed changing that value to be Ignore so that you
would have (Stop, Inquire, Continue and Ignore). Some might argue that
Ignore doesn't adequately indicate that all traces of the error are, well,
ignored. But I would argue that Continue doesn't really indicate that error
messages will still be output. OTOH when you have Continue together with
SilentlyContinue this helps clarify the behaviors of each.

--
Keith


My System SpecsSystem Spec
Old 01-18-2007   #4 (permalink)
/\/\o\/\/ [MVP]
Guest


 

Re: parameter abbreviation

if you use my tabcompletion (
http://thepowershellguy.com/blogs/po.../powertab.aspx ),
you can do this :

PS H:\> add-tabExpansion 'sc' 'SilentlyContinue'

Filter Text
Type
------ ----
----
sc SilentlyContinue
Custom

now the first tab will give Set-Content and on the second tab you will get
SilentlyContinue

Greetings /\/\o\/\/


"Keith Hill [MVP]" wrote:

> "$hay" <no@addre.ss> wrote in message
> news:%23JURIjnOHHA.3268@TK2MSFTNGP03.phx.gbl...
> > can parameters be abbreviated?
> >
> > like shortening SilentlyContinue into something like sc???

>
> I've disliked SilentlyContinue from the get go. It is just too darn long to
> type. At one time I proposed changing that value to be Ignore so that you
> would have (Stop, Inquire, Continue and Ignore). Some might argue that
> Ignore doesn't adequately indicate that all traces of the error are, well,
> ignored. But I would argue that Continue doesn't really indicate that error
> messages will still be output. OTOH when you have Continue together with
> SilentlyContinue this helps clarify the behaviors of each.
>
> --
> Keith
>
>
>

My System SpecsSystem Spec
Old 01-18-2007   #5 (permalink)
$hay
Guest


 

Re: parameter abbreviation

very powerfull staff!

Cheers

--
$hay
http://scriptolog.blogspot.com



"/\/\o\/\/ [MVP]" <oMVP@discussions.microsoft.com> wrote in message
news:568141EC-B2CC-4655-8DD6-CC1E5B768EF7@microsoft.com...
> if you use my tabcompletion (
> http://thepowershellguy.com/blogs/po.../powertab.aspx ),
> you can do this :
>
> PS H:\> add-tabExpansion 'sc' 'SilentlyContinue'
>
> Filter Text
> Type
> ------ ----
> ----
> sc SilentlyContinue
> Custom
>
> now the first tab will give Set-Content and on the second tab you will get
> SilentlyContinue
>
> Greetings /\/\o\/\/
>
>
> "Keith Hill [MVP]" wrote:
>
>> "$hay" <no@addre.ss> wrote in message
>> news:%23JURIjnOHHA.3268@TK2MSFTNGP03.phx.gbl...
>> > can parameters be abbreviated?
>> >
>> > like shortening SilentlyContinue into something like sc???

>>
>> I've disliked SilentlyContinue from the get go. It is just too darn long
>> to
>> type. At one time I proposed changing that value to be Ignore so that
>> you
>> would have (Stop, Inquire, Continue and Ignore). Some might argue that
>> Ignore doesn't adequately indicate that all traces of the error are,
>> well,
>> ignored. But I would argue that Continue doesn't really indicate that
>> error
>> messages will still be output. OTOH when you have Continue together with
>> SilentlyContinue this helps clarify the behaviors of each.
>>
>> --
>> Keith
>>
>>
>>



My System SpecsSystem Spec
Old 01-18-2007   #6 (permalink)
/\\/\\o\\/\\/ [MVP]
Guest


 

Re: parameter abbreviation

Thanks,
b.t.w. in this case a good alias to use for SilentlyContinue is 0


PoSH> [System.Management.Automation.ActionPreference]::SilentlyContinue
SilentlyContinue
PoSH> [int][System.Management.Automation.ActionPreference]::SilentlyContinue
0
PoSH> ls dfjhl
Get-ChildItem : Cannot find path 'C:\PowerShell\dfjhl' because it does not
exist.
At line:1 char:3
+ ls <<<< dfjhl
PoSH> ls dfjhl -ea 0

Greetings /\/\o\/\/

"$hay" <no@addre.ss> wrote in message
news:ue9s8PyOHHA.4332@TK2MSFTNGP03.phx.gbl...
> very powerfull staff!
>
> Cheers
>
> --
> $hay
> http://scriptolog.blogspot.com
>
>
>
> "/\/\o\/\/ [MVP]" <oMVP@discussions.microsoft.com> wrote in message
> news:568141EC-B2CC-4655-8DD6-CC1E5B768EF7@microsoft.com...
>> if you use my tabcompletion (
>> http://thepowershellguy.com/blogs/po.../powertab.aspx ),
>> you can do this :
>>
>> PS H:\> add-tabExpansion 'sc' 'SilentlyContinue'
>>
>> Filter Text
>> Type
>> ------ ----
>> ----
>> sc SilentlyContinue
>> Custom
>>
>> now the first tab will give Set-Content and on the second tab you will
>> get
>> SilentlyContinue
>>
>> Greetings /\/\o\/\/
>>
>>
>> "Keith Hill [MVP]" wrote:
>>
>>> "$hay" <no@addre.ss> wrote in message
>>> news:%23JURIjnOHHA.3268@TK2MSFTNGP03.phx.gbl...
>>> > can parameters be abbreviated?
>>> >
>>> > like shortening SilentlyContinue into something like sc???
>>>
>>> I've disliked SilentlyContinue from the get go. It is just too darn
>>> long to
>>> type. At one time I proposed changing that value to be Ignore so that
>>> you
>>> would have (Stop, Inquire, Continue and Ignore). Some might argue that
>>> Ignore doesn't adequately indicate that all traces of the error are,
>>> well,
>>> ignored. But I would argue that Continue doesn't really indicate that
>>> error
>>> messages will still be output. OTOH when you have Continue together
>>> with
>>> SilentlyContinue this helps clarify the behaviors of each.
>>>
>>> --
>>> Keith
>>>
>>>
>>>

>
>


My System SpecsSystem Spec
Old 01-18-2007   #7 (permalink)
$hay
Guest


 

Re: parameter abbreviation

certainly the shortest that can be :-)

--
$hay
http://scriptolog.blogspot.com



"/\/\o\/\/ [MVP]" <mow001@hotmail.NoSpam> wrote in message
news:413CC5B5-B2B2-4856-A634-573C99D60D8F@microsoft.com...
> Thanks,
> b.t.w. in this case a good alias to use for SilentlyContinue is 0
>
>
> PoSH> [System.Management.Automation.ActionPreference]::SilentlyContinue
> SilentlyContinue
> PoSH>
> [int][System.Management.Automation.ActionPreference]::SilentlyContinue
> 0
> PoSH> ls dfjhl
> Get-ChildItem : Cannot find path 'C:\PowerShell\dfjhl' because it does not
> exist.
> At line:1 char:3
> + ls <<<< dfjhl
> PoSH> ls dfjhl -ea 0
>
> Greetings /\/\o\/\/
>
> "$hay" <no@addre.ss> wrote in message
> news:ue9s8PyOHHA.4332@TK2MSFTNGP03.phx.gbl...
>> very powerfull staff!
>>
>> Cheers
>>
>> --
>> $hay
>> http://scriptolog.blogspot.com
>>
>>
>>
>> "/\/\o\/\/ [MVP]" <oMVP@discussions.microsoft.com> wrote in message
>> news:568141EC-B2CC-4655-8DD6-CC1E5B768EF7@microsoft.com...
>>> if you use my tabcompletion (
>>> http://thepowershellguy.com/blogs/po.../powertab.aspx ),
>>> you can do this :
>>>
>>> PS H:\> add-tabExpansion 'sc' 'SilentlyContinue'
>>>
>>> Filter Text
>>> Type
>>> ------ ----
>>> ----
>>> sc SilentlyContinue
>>> Custom
>>>
>>> now the first tab will give Set-Content and on the second tab you will
>>> get
>>> SilentlyContinue
>>>
>>> Greetings /\/\o\/\/
>>>
>>>
>>> "Keith Hill [MVP]" wrote:
>>>
>>>> "$hay" <no@addre.ss> wrote in message
>>>> news:%23JURIjnOHHA.3268@TK2MSFTNGP03.phx.gbl...
>>>> > can parameters be abbreviated?
>>>> >
>>>> > like shortening SilentlyContinue into something like sc???
>>>>
>>>> I've disliked SilentlyContinue from the get go. It is just too darn
>>>> long to
>>>> type. At one time I proposed changing that value to be Ignore so that
>>>> you
>>>> would have (Stop, Inquire, Continue and Ignore). Some might argue that
>>>> Ignore doesn't adequately indicate that all traces of the error are,
>>>> well,
>>>> ignored. But I would argue that Continue doesn't really indicate that
>>>> error
>>>> messages will still be output. OTOH when you have Continue together
>>>> with
>>>> SilentlyContinue this helps clarify the behaviors of each.
>>>>
>>>> --
>>>> Keith
>>>>
>>>>
>>>>

>>
>>

>



My System SpecsSystem Spec
Old 01-19-2007   #8 (permalink)
/\\/\\o\\/\\/ [MVP]
Guest


 

Re: parameter abbreviation

I made another part in the series about the Tabcompletion, about making you
own Custom "Tab - Only" alliases, and adding them to the tabcompletion.

http://thepowershellguy.com/blogs/po...utilities.aspx

bugs, tips, feature requests and questions welcome !!


Greetings /\/\o\/\/

"$hay" <no@addre.ss> wrote in message
news:eibt020OHHA.3872@TK2MSFTNGP06.phx.gbl...
> certainly the shortest that can be :-)
>
> --
> $hay
> http://scriptolog.blogspot.com
>
>
>
> "/\/\o\/\/ [MVP]" <mow001@hotmail.NoSpam> wrote in message
> news:413CC5B5-B2B2-4856-A634-573C99D60D8F@microsoft.com...
>> Thanks,
>> b.t.w. in this case a good alias to use for SilentlyContinue is 0
>>
>>
>> PoSH> [System.Management.Automation.ActionPreference]::SilentlyContinue
>> SilentlyContinue
>> PoSH>
>> [int][System.Management.Automation.ActionPreference]::SilentlyContinue
>> 0
>> PoSH> ls dfjhl
>> Get-ChildItem : Cannot find path 'C:\PowerShell\dfjhl' because it does
>> not exist.
>> At line:1 char:3
>> + ls <<<< dfjhl
>> PoSH> ls dfjhl -ea 0
>>
>> Greetings /\/\o\/\/
>>
>> "$hay" <no@addre.ss> wrote in message
>> news:ue9s8PyOHHA.4332@TK2MSFTNGP03.phx.gbl...
>>> very powerfull staff!
>>>
>>> Cheers
>>>
>>> --
>>> $hay
>>> http://scriptolog.blogspot.com
>>>
>>>
>>>
>>> "/\/\o\/\/ [MVP]" <oMVP@discussions.microsoft.com> wrote in message
>>> news:568141EC-B2CC-4655-8DD6-CC1E5B768EF7@microsoft.com...
>>>> if you use my tabcompletion (
>>>> http://thepowershellguy.com/blogs/po.../powertab.aspx ),
>>>> you can do this :
>>>>
>>>> PS H:\> add-tabExpansion 'sc' 'SilentlyContinue'
>>>>
>>>> Filter Text
>>>> Type
>>>> ------ ----
>>>> ----
>>>> sc SilentlyContinue
>>>> Custom
>>>>
>>>> now the first tab will give Set-Content and on the second tab you will
>>>> get
>>>> SilentlyContinue
>>>>
>>>> Greetings /\/\o\/\/
>>>>
>>>>
>>>> "Keith Hill [MVP]" wrote:
>>>>
>>>>> "$hay" <no@addre.ss> wrote in message
>>>>> news:%23JURIjnOHHA.3268@TK2MSFTNGP03.phx.gbl...
>>>>> > can parameters be abbreviated?
>>>>> >
>>>>> > like shortening SilentlyContinue into something like sc???
>>>>>
>>>>> I've disliked SilentlyContinue from the get go. It is just too darn
>>>>> long to
>>>>> type. At one time I proposed changing that value to be Ignore so that
>>>>> you
>>>>> would have (Stop, Inquire, Continue and Ignore). Some might argue
>>>>> that
>>>>> Ignore doesn't adequately indicate that all traces of the error are,
>>>>> well,
>>>>> ignored. But I would argue that Continue doesn't really indicate that
>>>>> error
>>>>> messages will still be output. OTOH when you have Continue together
>>>>> with
>>>>> SilentlyContinue this helps clarify the behaviors of each.
>>>>>
>>>>> --
>>>>> Keith
>>>>>
>>>>>
>>>>>
>>>
>>>

>>

>
>


My System SpecsSystem Spec
Old 01-21-2007   #9 (permalink)
Adam Milazzo
Guest


 

Re: parameter abbreviation

$hay wrote:
> can parameters be abbreviated?
>
> like shortening SilentlyContinue into something like sc???


Can't you do something like Si* instead of SilentlyContinue? I thought
you could.
My System SpecsSystem Spec
Old 01-21-2007   #10 (permalink)
$hay
Guest


 

Re: parameter abbreviation

As /\/\o\/\/ replied, replacing SilentlyContinue with 0 is the same.
Still, if theres a way to shorten any other paramaters...

--
$hay
http://scriptolog.blogspot.com



"Adam Milazzo" <adamm@san.rr.com> wrote in message
news:OK5Ip3UPHHA.1552@TK2MSFTNGP05.phx.gbl...
> $hay wrote:
>> can parameters be abbreviated?
>>
>> like shortening SilentlyContinue into something like sc???

>
> Can't you do something like Si* instead of SilentlyContinue? I thought
> you could.



My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using multiple Parameter sets for a Parameter AgentM PowerShell 2 07-29-2008 01:41 AM
Speech Recognition and Abbreviation Rob N Vista General 0 05-02-2008 05:11 PM
parameter set fun Darren Mar-Elia PowerShell 18 01-28-2008 08:46 PM
What is Parameter HelpMessage for? John Vottero PowerShell 1 07-19-2007 07:02 PM
How to best control parameter attributes and parameter parsing in your own scripts? Audun Gjerken PowerShell 1 03-04-2007 04:07 PM


Update your Vista Drivers Update Your Vista Drivers Now!!

Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008
Page generated in 0.33387 seconds with 10 queries