Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Set-Content : The given path's format is not supported.

Reply
 
Old 01-15-2007   #1 (permalink)
Gaurhoth


 
 

Set-Content : The given path's format is not supported.

Does Set-Content not support PSDrive paths? Or am I doing something wrong? See Below for an example...

PS ps:\> New-PSDrive -Name test1 -PSProvider FileSystem -Root "C:\psscripts\"

Name Provider Root CurrentLocation
---- -------- ---- ---------------
test1 FileSystem C:\psscripts\


PS ps:\> Set-Location test1:
PS test1:\> "This is a test string" | set-content -path "test1:\testfile.txt"
Set-Content : The given path's format is not supported.
At line:1 char:38
+ "This is a test string" | set-content <<<< -path "test1:\testfile.txt"
Set-Content : The given path's format is not supported.
At line:1 char:38
+ "This is a test string" | set-content <<<< -path "test1:\testfile.txt"
PS test1:\>


--

gaurhoth
http://gaurhothw.spaces.live.com/



My System SpecsSystem Spec
Old 01-16-2007   #2 (permalink)
$hay


 
 

Re: Set-Content : The given path's format is not supported.

check that the file test1:\testfile.txt exists.
it worked for me

--
$hay
http://scriptolog.blogspot.com
"Gaurhoth" <gaurhoth@live.com> wrote in message news:uaK69VQOHHA.324@TK2MSFTNGP06.phx.gbl...
Does Set-Content not support PSDrive paths? Or am I doing something wrong? See Below for an example...

PS ps:\> New-PSDrive -Name test1 -PSProvider FileSystem -Root "C:\psscripts\"

Name Provider Root CurrentLocation
---- -------- ---- ---------------
test1 FileSystem C:\psscripts\


PS ps:\> Set-Location test1:
PS test1:\> "This is a test string" | set-content -path "test1:\testfile.txt"
Set-Content : The given path's format is not supported.
At line:1 char:38
+ "This is a test string" | set-content <<<< -path "test1:\testfile.txt"
Set-Content : The given path's format is not supported.
At line:1 char:38
+ "This is a test string" | set-content <<<< -path "test1:\testfile.txt"
PS test1:\>


--

gaurhoth
http://gaurhothw.spaces.live.com/


My System SpecsSystem Spec
Old 01-16-2007   #3 (permalink)
Andrew Watt [MVP]


 
 

Re: Set-Content : The given path's format is not supported.

Hi,

Looks like a bug to me. I can reproduce the behaviour you describe
with set-content.

As Shay says it works if the file already exists.

The problem exists when you use test1: in the path or are in test1:
and use set-location.

Same problem seems to exist, on initial testing, with add-content.

Do you have access to Connect to report the bug?

Andrew Watt MVP

On Mon, 15 Jan 2007 19:30:12 -0500, "Gaurhoth" <gaurhoth@live.com>
wrote:

>Does Set-Content not support PSDrive paths? Or am I doing something wrong? See Below for an example...
>
>PS ps:\> New-PSDrive -Name test1 -PSProvider FileSystem -Root "C:\psscripts\"
>
>Name Provider Root CurrentLocation
>---- -------- ---- ---------------
>test1 FileSystem C:\psscripts\
>
>
>PS ps:\> Set-Location test1:
>PS test1:\> "This is a test string" | set-content -path "test1:\testfile.txt"
>Set-Content : The given path's format is not supported.
>At line:1 char:38
>+ "This is a test string" | set-content <<<< -path "test1:\testfile.txt"
>Set-Content : The given path's format is not supported.
>At line:1 char:38
>+ "This is a test string" | set-content <<<< -path "test1:\testfile.txt"
>PS test1:\>
>
>
>--
>
>gaurhoth
>http://gaurhothw.spaces.live.com/

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Audio format is not supported by the current application. Vista music pictures video
file format is not supported Vista music pictures video
JPEG format not supported Vista General
Tab expansion on path's with square braces is broken PowerShell
Weirdness with get-content | replace | set-content - file content is deleted!! PowerShell


Vista Forums 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 Ltd

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