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

Question about documentation and embedded blanks

Closed Thread
 
Thread Tools Display Modes
Old 04-10-2007   #1 (permalink)
Frank S
Guest


 

Question about documentation and embedded blanks

I can't seem to find the documentation that provides an answer to the relatively simple problem
below. Where should I look?

---------------------------
Below is a brief excerpt from a PS script. When I pass a path with embedded blanks I receive an
error on the "get-item" line.

param($file1=$(throw "param file1 required"), $file2=$(throw "param file2
required"))

## both files must exist
$f1 = get-item $file1

---------------------------

Regards,

Frank
Old 04-11-2007   #2 (permalink)
Frank S
Guest


 

Re: Question about documentation and embedded blanks

Frank S wrote:
> I can't seem to find the documentation that provides an answer to the
> relatively simple problem below. Where should I look?
>
> ---------------------------
> Below is a brief excerpt from a PS script. When I pass a path with
> embedded blanks I receive an error on the "get-item" line.
>
> param($file1=$(throw "param file1 required"), $file2=$(throw "param file2
> required"))
>
> ## both files must exist
> $f1 = get-item $file1
>
> ---------------------------
>
> Regards,
>
> Frank


The "get-item" line is not the root problem. I use a command line like:

>powershell "& '%script%\myscript.ps1' file1 file2"


The problem occurs when file1 or file2 contains spaces.

--
Regards,

Frank
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display blanks and does not go to sleep Mike Vista hardware & devices 2 01-11-2008 12:33 PM
display blanks out scott0622 Vista hardware & devices 2 09-16-2007 11:04 PM
Embedded fonts question Walter Blanchard Vista mail 1 07-31-2007 06:30 AM
params containing blanks Jay PowerShell 3 06-20-2007 09:06 AM
Vista Screen Blanks Skip Vista General 4 03-15-2007 03:20 PM








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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50