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

String formating

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


 

String formating

Hi all,
I'm facing some problems with path containing space, the invoke-expression
doens't handle this very well. How to you process such pathes ?

Another string problem come from I need to declare some strings with double
quotes inside, how do I build these strings ?

Many thanks in advance for the help.

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


 

Re: String formating

> I'm facing some problems with path containing space, the invoke-expression
> doens't handle this very well. How to you process such pathes ?

Use single quotes... if you can provide an example that would help

> Another string problem come from I need to declare some strings with
> double
> quotes inside, how do I build these strings ?


You can escape the " using `
example
PS > $msg = "I want to say `"hello`""
PS > $msg
I want to say "hello"
--

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

"Romu" <Romu@discussions.microsoft.com> wrote in message
news:8016B4FD-031B-4FC5-92B6-7FC2AC9F1E00@microsoft.com...
> Hi all,
> I'm facing some problems with path containing space, the invoke-expression
> doens't handle this very well. How to you process such pathes ?
>
> Another string problem come from I need to declare some strings with
> double
> quotes inside, how do I build these strings ?
>
> Many thanks in advance for the help.


My System SpecsSystem Spec
Old 01-17-2007   #3 (permalink)
$hay
Guest


 

Re: String formating

type into PS

"<a href=""http://scriptolog.blogspot.com"" target=""_blank"">Script
Fanatics blog</a>"

and it will render as:

<a href="http://scriptolog.blogspot.com" target="_blank">Script Fanatics
blog</a>

basically, add extra quote for each desired one and wrap the whole string
with quotes

--
$hay
http://scriptolog.blogspot.com
"Brandon Shell" <tshell.mask@gmail.com> wrote in message
news:u6Z648lOHHA.2232@TK2MSFTNGP02.phx.gbl...
>> I'm facing some problems with path containing space, the
>> invoke-expression
>> doens't handle this very well. How to you process such pathes ?

> Use single quotes... if you can provide an example that would help
>
>> Another string problem come from I need to declare some strings with
>> double
>> quotes inside, how do I build these strings ?

>
> You can escape the " using `
> example
> PS > $msg = "I want to say `"hello`""
> PS > $msg
> I want to say "hello"
> --
>
> Brandon Shell
> ---------------
> Stop by my blog some time
> http://mybsinfo.blogspot.com/
> ----------------------------------
>
> "Romu" <Romu@discussions.microsoft.com> wrote in message
> news:8016B4FD-031B-4FC5-92B6-7FC2AC9F1E00@microsoft.com...
>> Hi all,
>> I'm facing some problems with path containing space, the
>> invoke-expression
>> doens't handle this very well. How to you process such pathes ?
>>
>> Another string problem come from I need to declare some strings with
>> double
>> quotes inside, how do I build these strings ?
>>
>> Many thanks in advance for the help.

>



My System SpecsSystem Spec
Old 01-18-2007   #4 (permalink)
Romu
Guest


 

Re: String formating

Many to you guys.

Romu

"$hay" wrote:

> type into PS
>
> "<a href=""http://scriptolog.blogspot.com"" target=""_blank"">Script
> Fanatics blog</a>"
>
> and it will render as:
>
> <a href="http://scriptolog.blogspot.com" target="_blank">Script Fanatics
> blog</a>
>
> basically, add extra quote for each desired one and wrap the whole string
> with quotes
>
> --
> $hay
> http://scriptolog.blogspot.com
> "Brandon Shell" <tshell.mask@gmail.com> wrote in message
> news:u6Z648lOHHA.2232@TK2MSFTNGP02.phx.gbl...
> >> I'm facing some problems with path containing space, the
> >> invoke-expression
> >> doens't handle this very well. How to you process such pathes ?

> > Use single quotes... if you can provide an example that would help
> >
> >> Another string problem come from I need to declare some strings with
> >> double
> >> quotes inside, how do I build these strings ?

> >
> > You can escape the " using `
> > example
> > PS > $msg = "I want to say `"hello`""
> > PS > $msg
> > I want to say "hello"
> > --
> >
> > Brandon Shell
> > ---------------
> > Stop by my blog some time
> > http://mybsinfo.blogspot.com/
> > ----------------------------------
> >
> > "Romu" <Romu@discussions.microsoft.com> wrote in message
> > news:8016B4FD-031B-4FC5-92B6-7FC2AC9F1E00@microsoft.com...
> >> Hi all,
> >> I'm facing some problems with path containing space, the
> >> invoke-expression
> >> doens't handle this very well. How to you process such pathes ?
> >>
> >> Another string problem come from I need to declare some strings with
> >> double
> >> quotes inside, how do I build these strings ?
> >>
> >> Many thanks in advance for the help.

> >

>
>
>

My System SpecsSystem Spec
Old 01-27-2007   #5 (permalink)
Vasily Gusev
Guest


 

Re: String formating

Also you can wrap quotes into '' block:

'<a href="http://scriptolog.blogspot.com" target="_blank">Script Fanatics
blog</a>'

"$hay" <no@addre.ss> wrote in message
news:eV5ozXnOHHA.1252@TK2MSFTNGP02.phx.gbl...
> type into PS
>
> "<a href=""http://scriptolog.blogspot.com"" target=""_blank"">Script
> Fanatics blog</a>"
>
> and it will render as:
>
> <a href="http://scriptolog.blogspot.com" target="_blank">Script Fanatics
> blog</a>
>
> basically, add extra quote for each desired one and wrap the whole string
> with quotes
>
> --
> $hay
> http://scriptolog.blogspot.com
> "Brandon Shell" <tshell.mask@gmail.com> wrote in message
> news:u6Z648lOHHA.2232@TK2MSFTNGP02.phx.gbl...
>>> I'm facing some problems with path containing space, the
>>> invoke-expression
>>> doens't handle this very well. How to you process such pathes ?

>> Use single quotes... if you can provide an example that would help
>>
>>> Another string problem come from I need to declare some strings with
>>> double
>>> quotes inside, how do I build these strings ?

>>
>> You can escape the " using `
>> example
>> PS > $msg = "I want to say `"hello`""
>> PS > $msg
>> I want to say "hello"
>> --
>>
>> Brandon Shell
>> ---------------
>> Stop by my blog some time
>> http://mybsinfo.blogspot.com/
>> ----------------------------------
>>
>> "Romu" <Romu@discussions.microsoft.com> wrote in message
>> news:8016B4FD-031B-4FC5-92B6-7FC2AC9F1E00@microsoft.com...
>>> Hi all,
>>> I'm facing some problems with path containing space, the
>>> invoke-expression
>>> doens't handle this very well. How to you process such pathes ?
>>>
>>> Another string problem come from I need to declare some strings with
>>> double
>>> quotes inside, how do I build these strings ?
>>>
>>> Many thanks in advance for the help.

>>

>
>


My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find a string within a variable string Edward.A.Gonzalez PowerShell 4 08-15-2008 08:13 AM
problems with $var | select-string -pattern $string -q Ben Christian PowerShell 3 02-08-2008 12:41 PM
How export-csv deals with string versus string[] Marco Shaw PowerShell 2 07-13-2007 12:18 PM
String PRODUCT_NAME was not found in string table Extracampine Vista General 3 02-12-2007 06:15 AM


Update your Vista Drivers Update Your 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