Get-ChildItem | tree gives me a wierdly formatted tree
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
The following input:
PS STG:> Get-ChildItem | tree
Gives me
Folder PATH listing for volume Data
Volume serial number is 6576-C540
D:.
ÃÄÄÄAPK
ÃÄÄÄAssets
³ ÃÄÄÄAnimations
³ ³ ÃÄÄÄCharacters
³ ³ ³ ÀÄÄÄinhabitant
³ ³ ÃÄÄÄEnvironment
³ ³ ÀÄÄÄProps
³ ÃÄÄÄMaterials
³ ³ ÃÄÄÄCharacters
³ ³ ³ ÀÄÄÄinhabitant
³ ³ ÃÄÄÄEnvironment
³ ³ ÃÄÄÄParticles
³ ³ ³ ÀÄÄÄasteroidParticle
³ ³ ÀÄÄÄProps
³ ÃÄÄÄMeshes
³ ³ ÃÄÄÄCharacters
³ ³ ³ ÀÄÄÄinhabitant
³ ³ ÃÄÄÄEnvironment
³ ³ ÀÄÄÄProps
...etc.
When I was expecting something formatted more like:
├───APK
├───Assets
└───Animations
| └───Characters
| | └───inhabitant
| ├───Environment
| └───Props
└───Materials
| └───Characters
| | └───inhabitant
| ├───Environment
| └───Particles
| | └───asteroidParticle
| └───Props
└───Meshes
└───Characters
| └───inhabitant
├───Environment
└───Props
What am I doing / understanding wrong?
This is the value of $OutputEncoding:
IsSingleByte : True
BodyName : iso-8859-1
EncodingName : Western European (Windows)
HeaderName : Windows-1252
WebName : Windows-1252
WindowsCodePage : 1252
IsBrowserDisplay : True
IsBrowserSave : True
IsMailNewsDisplay : True
IsMailNewsSave : True
EncoderFallback : System.Text.InternalEncoderBestFitFallback
DecoderFallback : System.Text.InternalDecoderBestFitFallback
IsReadOnly : True
CodePage : 1252`
powershell powershell-4.0
|
show 7 more comments
The following input:
PS STG:> Get-ChildItem | tree
Gives me
Folder PATH listing for volume Data
Volume serial number is 6576-C540
D:.
ÃÄÄÄAPK
ÃÄÄÄAssets
³ ÃÄÄÄAnimations
³ ³ ÃÄÄÄCharacters
³ ³ ³ ÀÄÄÄinhabitant
³ ³ ÃÄÄÄEnvironment
³ ³ ÀÄÄÄProps
³ ÃÄÄÄMaterials
³ ³ ÃÄÄÄCharacters
³ ³ ³ ÀÄÄÄinhabitant
³ ³ ÃÄÄÄEnvironment
³ ³ ÃÄÄÄParticles
³ ³ ³ ÀÄÄÄasteroidParticle
³ ³ ÀÄÄÄProps
³ ÃÄÄÄMeshes
³ ³ ÃÄÄÄCharacters
³ ³ ³ ÀÄÄÄinhabitant
³ ³ ÃÄÄÄEnvironment
³ ³ ÀÄÄÄProps
...etc.
When I was expecting something formatted more like:
├───APK
├───Assets
└───Animations
| └───Characters
| | └───inhabitant
| ├───Environment
| └───Props
└───Materials
| └───Characters
| | └───inhabitant
| ├───Environment
| └───Particles
| | └───asteroidParticle
| └───Props
└───Meshes
└───Characters
| └───inhabitant
├───Environment
└───Props
What am I doing / understanding wrong?
This is the value of $OutputEncoding:
IsSingleByte : True
BodyName : iso-8859-1
EncodingName : Western European (Windows)
HeaderName : Windows-1252
WebName : Windows-1252
WindowsCodePage : 1252
IsBrowserDisplay : True
IsBrowserSave : True
IsMailNewsDisplay : True
IsMailNewsSave : True
EncoderFallback : System.Text.InternalEncoderBestFitFallback
DecoderFallback : System.Text.InternalDecoderBestFitFallback
IsReadOnly : True
CodePage : 1252`
powershell powershell-4.0
in powershell type $OutputEncoding and paste the results
– Keltari
Apr 23 '14 at 14:30
See edit in post.
– aPerfectMisterMan
Apr 23 '14 at 14:34
@MHA, please copy the detail into your original post - the post can be edited.
– Dave
Apr 23 '14 at 14:36
It definitely looks like an encoding problem. My tree works and the encoding is us-ascii. IsSingleByte : True BodyName : us-ascii EncodingName : US-ASCII HeaderName : us-ascii WebName : us-ascii WindowsCodePage : 1252 IsBrowserDisplay : False IsBrowserSave : False IsMailNewsDisplay : True IsMailNewsSave : True EncoderFallback : System.Text.EncoderReplacementFallback DecoderFallback : System.Text.DecoderReplacementFallback IsReadOnly : True CodePage : 20127
– Keltari
Apr 23 '14 at 14:40
1
@MHA Does using the ascii switch for tree help?gci| tree /A
– Rynant
Apr 24 '14 at 14:40
|
show 7 more comments
The following input:
PS STG:> Get-ChildItem | tree
Gives me
Folder PATH listing for volume Data
Volume serial number is 6576-C540
D:.
ÃÄÄÄAPK
ÃÄÄÄAssets
³ ÃÄÄÄAnimations
³ ³ ÃÄÄÄCharacters
³ ³ ³ ÀÄÄÄinhabitant
³ ³ ÃÄÄÄEnvironment
³ ³ ÀÄÄÄProps
³ ÃÄÄÄMaterials
³ ³ ÃÄÄÄCharacters
³ ³ ³ ÀÄÄÄinhabitant
³ ³ ÃÄÄÄEnvironment
³ ³ ÃÄÄÄParticles
³ ³ ³ ÀÄÄÄasteroidParticle
³ ³ ÀÄÄÄProps
³ ÃÄÄÄMeshes
³ ³ ÃÄÄÄCharacters
³ ³ ³ ÀÄÄÄinhabitant
³ ³ ÃÄÄÄEnvironment
³ ³ ÀÄÄÄProps
...etc.
When I was expecting something formatted more like:
├───APK
├───Assets
└───Animations
| └───Characters
| | └───inhabitant
| ├───Environment
| └───Props
└───Materials
| └───Characters
| | └───inhabitant
| ├───Environment
| └───Particles
| | └───asteroidParticle
| └───Props
└───Meshes
└───Characters
| └───inhabitant
├───Environment
└───Props
What am I doing / understanding wrong?
This is the value of $OutputEncoding:
IsSingleByte : True
BodyName : iso-8859-1
EncodingName : Western European (Windows)
HeaderName : Windows-1252
WebName : Windows-1252
WindowsCodePage : 1252
IsBrowserDisplay : True
IsBrowserSave : True
IsMailNewsDisplay : True
IsMailNewsSave : True
EncoderFallback : System.Text.InternalEncoderBestFitFallback
DecoderFallback : System.Text.InternalDecoderBestFitFallback
IsReadOnly : True
CodePage : 1252`
powershell powershell-4.0
The following input:
PS STG:> Get-ChildItem | tree
Gives me
Folder PATH listing for volume Data
Volume serial number is 6576-C540
D:.
ÃÄÄÄAPK
ÃÄÄÄAssets
³ ÃÄÄÄAnimations
³ ³ ÃÄÄÄCharacters
³ ³ ³ ÀÄÄÄinhabitant
³ ³ ÃÄÄÄEnvironment
³ ³ ÀÄÄÄProps
³ ÃÄÄÄMaterials
³ ³ ÃÄÄÄCharacters
³ ³ ³ ÀÄÄÄinhabitant
³ ³ ÃÄÄÄEnvironment
³ ³ ÃÄÄÄParticles
³ ³ ³ ÀÄÄÄasteroidParticle
³ ³ ÀÄÄÄProps
³ ÃÄÄÄMeshes
³ ³ ÃÄÄÄCharacters
³ ³ ³ ÀÄÄÄinhabitant
³ ³ ÃÄÄÄEnvironment
³ ³ ÀÄÄÄProps
...etc.
When I was expecting something formatted more like:
├───APK
├───Assets
└───Animations
| └───Characters
| | └───inhabitant
| ├───Environment
| └───Props
└───Materials
| └───Characters
| | └───inhabitant
| ├───Environment
| └───Particles
| | └───asteroidParticle
| └───Props
└───Meshes
└───Characters
| └───inhabitant
├───Environment
└───Props
What am I doing / understanding wrong?
This is the value of $OutputEncoding:
IsSingleByte : True
BodyName : iso-8859-1
EncodingName : Western European (Windows)
HeaderName : Windows-1252
WebName : Windows-1252
WindowsCodePage : 1252
IsBrowserDisplay : True
IsBrowserSave : True
IsMailNewsDisplay : True
IsMailNewsSave : True
EncoderFallback : System.Text.InternalEncoderBestFitFallback
DecoderFallback : System.Text.InternalDecoderBestFitFallback
IsReadOnly : True
CodePage : 1252`
powershell powershell-4.0
powershell powershell-4.0
edited Oct 15 '14 at 14:09
Kevin Panko
5,979113648
5,979113648
asked Apr 23 '14 at 14:25
aPerfectMisterManaPerfectMisterMan
12615
12615
in powershell type $OutputEncoding and paste the results
– Keltari
Apr 23 '14 at 14:30
See edit in post.
– aPerfectMisterMan
Apr 23 '14 at 14:34
@MHA, please copy the detail into your original post - the post can be edited.
– Dave
Apr 23 '14 at 14:36
It definitely looks like an encoding problem. My tree works and the encoding is us-ascii. IsSingleByte : True BodyName : us-ascii EncodingName : US-ASCII HeaderName : us-ascii WebName : us-ascii WindowsCodePage : 1252 IsBrowserDisplay : False IsBrowserSave : False IsMailNewsDisplay : True IsMailNewsSave : True EncoderFallback : System.Text.EncoderReplacementFallback DecoderFallback : System.Text.DecoderReplacementFallback IsReadOnly : True CodePage : 20127
– Keltari
Apr 23 '14 at 14:40
1
@MHA Does using the ascii switch for tree help?gci| tree /A
– Rynant
Apr 24 '14 at 14:40
|
show 7 more comments
in powershell type $OutputEncoding and paste the results
– Keltari
Apr 23 '14 at 14:30
See edit in post.
– aPerfectMisterMan
Apr 23 '14 at 14:34
@MHA, please copy the detail into your original post - the post can be edited.
– Dave
Apr 23 '14 at 14:36
It definitely looks like an encoding problem. My tree works and the encoding is us-ascii. IsSingleByte : True BodyName : us-ascii EncodingName : US-ASCII HeaderName : us-ascii WebName : us-ascii WindowsCodePage : 1252 IsBrowserDisplay : False IsBrowserSave : False IsMailNewsDisplay : True IsMailNewsSave : True EncoderFallback : System.Text.EncoderReplacementFallback DecoderFallback : System.Text.DecoderReplacementFallback IsReadOnly : True CodePage : 20127
– Keltari
Apr 23 '14 at 14:40
1
@MHA Does using the ascii switch for tree help?gci| tree /A
– Rynant
Apr 24 '14 at 14:40
in powershell type $OutputEncoding and paste the results
– Keltari
Apr 23 '14 at 14:30
in powershell type $OutputEncoding and paste the results
– Keltari
Apr 23 '14 at 14:30
See edit in post.
– aPerfectMisterMan
Apr 23 '14 at 14:34
See edit in post.
– aPerfectMisterMan
Apr 23 '14 at 14:34
@MHA, please copy the detail into your original post - the post can be edited.
– Dave
Apr 23 '14 at 14:36
@MHA, please copy the detail into your original post - the post can be edited.
– Dave
Apr 23 '14 at 14:36
It definitely looks like an encoding problem. My tree works and the encoding is us-ascii. IsSingleByte : True BodyName : us-ascii EncodingName : US-ASCII HeaderName : us-ascii WebName : us-ascii WindowsCodePage : 1252 IsBrowserDisplay : False IsBrowserSave : False IsMailNewsDisplay : True IsMailNewsSave : True EncoderFallback : System.Text.EncoderReplacementFallback DecoderFallback : System.Text.DecoderReplacementFallback IsReadOnly : True CodePage : 20127
– Keltari
Apr 23 '14 at 14:40
It definitely looks like an encoding problem. My tree works and the encoding is us-ascii. IsSingleByte : True BodyName : us-ascii EncodingName : US-ASCII HeaderName : us-ascii WebName : us-ascii WindowsCodePage : 1252 IsBrowserDisplay : False IsBrowserSave : False IsMailNewsDisplay : True IsMailNewsSave : True EncoderFallback : System.Text.EncoderReplacementFallback DecoderFallback : System.Text.DecoderReplacementFallback IsReadOnly : True CodePage : 20127
– Keltari
Apr 23 '14 at 14:40
1
1
@MHA Does using the ascii switch for tree help?
gci| tree /A– Rynant
Apr 24 '14 at 14:40
@MHA Does using the ascii switch for tree help?
gci| tree /A– Rynant
Apr 24 '14 at 14:40
|
show 7 more comments
3 Answers
3
active
oldest
votes
Try using the Show-Tree commandlet.
09:17 $ Show-Tree C:Chocolatey -Depth 1
C:Chocolatey
|--bin
--lib
add a comment |
Depending on the version of PowerShell and the presence or absence of community extensions, you can actually end up calling C:WindowsSystem32tree.com. The gibberish is because PowerShell is not using the correct encoding to display the extended characters that tree.com uses by default. You can use chcp.com to see what the command processor's current code page setting is. The usual default is code page 437. PowerShell uses code page 1252 by default. There are to options for dealing with this that work well and are both low-impact and simple.
- Just use tree '/A'.
- Convert the output from tree to bytes and load it with the proper
code page using the following code:
tree | %{ [System.Text.Encoding]::GetEncoding('IBM437').GetString($OutputEncoding.GetBytes($_)) }
add a comment |
Are you running the command in Powershell or Powershell ISE?
There's a difference.
This is what I get in Powershell ISE:
PS C:powershell> Get-ChildItem | tree
Folder PATH listing
Volume serial number is XXXX-XXXX
C:.
ÃÄÄÄFolder 1
³ ÃÄÄÄSubfolder 1
³ ÃÄÄÄSubfolder 2
³ ÃÄÄÄSubfolder 3
³ ÀÄÄÄSubfolder 4
ÃÄÄÄFolder 2
³ ÃÄÄÄSubfolder 1
³ ÃÄÄÄSubfolder 2
³ ÃÄÄÄSubfolder 3
³ ÀÄÄÄSubfolder 4
ÃÄÄÄFolder 3
³ ÃÄÄÄSubfolder 1
³ ÃÄÄÄSubfolder 2
³ ÃÄÄÄSubfolder 3
³ ÀÄÄÄSubfolder 4
ÀÄÄÄFolder 4
ÃÄÄÄSubfolder 1
ÃÄÄÄSubfolder 2
ÃÄÄÄSubfolder 3
ÀÄÄÄSubfolder 4
PS C:powershell>
This is what I get in Powershell:
PS C:powershell> Get-childitem | tree
Folder PATH listing
Volume serial number is XXXX-XXXX
C:.
+---Folder 1
¦ +---Subfolder 1
¦ +---Subfolder 2
¦ +---Subfolder 3
¦ +---Subfolder 4
+---Folder 2
¦ +---Subfolder 1
¦ +---Subfolder 2
¦ +---Subfolder 3
¦ +---Subfolder 4
+---Folder 3
¦ +---Subfolder 1
¦ +---Subfolder 2
¦ +---Subfolder 3
¦ +---Subfolder 4
+---Folder 4
+---Subfolder 1
+---Subfolder 2
+---Subfolder 3
+---Subfolder 4
PS C:powershell>
Interesting point here, but I must say my experience differs - tree output is the same regardless of using console or ISE. Do you have the community extensions installed, or is this using CMD's tree?
– Iszi
Oct 15 '14 at 14:17
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f745083%2fget-childitem-tree-gives-me-a-wierdly-formatted-tree%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try using the Show-Tree commandlet.
09:17 $ Show-Tree C:Chocolatey -Depth 1
C:Chocolatey
|--bin
--lib
add a comment |
Try using the Show-Tree commandlet.
09:17 $ Show-Tree C:Chocolatey -Depth 1
C:Chocolatey
|--bin
--lib
add a comment |
Try using the Show-Tree commandlet.
09:17 $ Show-Tree C:Chocolatey -Depth 1
C:Chocolatey
|--bin
--lib
Try using the Show-Tree commandlet.
09:17 $ Show-Tree C:Chocolatey -Depth 1
C:Chocolatey
|--bin
--lib
answered May 20 '15 at 6:17
John OxleyJohn Oxley
45231023
45231023
add a comment |
add a comment |
Depending on the version of PowerShell and the presence or absence of community extensions, you can actually end up calling C:WindowsSystem32tree.com. The gibberish is because PowerShell is not using the correct encoding to display the extended characters that tree.com uses by default. You can use chcp.com to see what the command processor's current code page setting is. The usual default is code page 437. PowerShell uses code page 1252 by default. There are to options for dealing with this that work well and are both low-impact and simple.
- Just use tree '/A'.
- Convert the output from tree to bytes and load it with the proper
code page using the following code:
tree | %{ [System.Text.Encoding]::GetEncoding('IBM437').GetString($OutputEncoding.GetBytes($_)) }
add a comment |
Depending on the version of PowerShell and the presence or absence of community extensions, you can actually end up calling C:WindowsSystem32tree.com. The gibberish is because PowerShell is not using the correct encoding to display the extended characters that tree.com uses by default. You can use chcp.com to see what the command processor's current code page setting is. The usual default is code page 437. PowerShell uses code page 1252 by default. There are to options for dealing with this that work well and are both low-impact and simple.
- Just use tree '/A'.
- Convert the output from tree to bytes and load it with the proper
code page using the following code:
tree | %{ [System.Text.Encoding]::GetEncoding('IBM437').GetString($OutputEncoding.GetBytes($_)) }
add a comment |
Depending on the version of PowerShell and the presence or absence of community extensions, you can actually end up calling C:WindowsSystem32tree.com. The gibberish is because PowerShell is not using the correct encoding to display the extended characters that tree.com uses by default. You can use chcp.com to see what the command processor's current code page setting is. The usual default is code page 437. PowerShell uses code page 1252 by default. There are to options for dealing with this that work well and are both low-impact and simple.
- Just use tree '/A'.
- Convert the output from tree to bytes and load it with the proper
code page using the following code:
tree | %{ [System.Text.Encoding]::GetEncoding('IBM437').GetString($OutputEncoding.GetBytes($_)) }
Depending on the version of PowerShell and the presence or absence of community extensions, you can actually end up calling C:WindowsSystem32tree.com. The gibberish is because PowerShell is not using the correct encoding to display the extended characters that tree.com uses by default. You can use chcp.com to see what the command processor's current code page setting is. The usual default is code page 437. PowerShell uses code page 1252 by default. There are to options for dealing with this that work well and are both low-impact and simple.
- Just use tree '/A'.
- Convert the output from tree to bytes and load it with the proper
code page using the following code:
tree | %{ [System.Text.Encoding]::GetEncoding('IBM437').GetString($OutputEncoding.GetBytes($_)) }
edited Jul 30 '18 at 23:17
answered Jul 30 '18 at 22:37
JamieSeeJamieSee
1113
1113
add a comment |
add a comment |
Are you running the command in Powershell or Powershell ISE?
There's a difference.
This is what I get in Powershell ISE:
PS C:powershell> Get-ChildItem | tree
Folder PATH listing
Volume serial number is XXXX-XXXX
C:.
ÃÄÄÄFolder 1
³ ÃÄÄÄSubfolder 1
³ ÃÄÄÄSubfolder 2
³ ÃÄÄÄSubfolder 3
³ ÀÄÄÄSubfolder 4
ÃÄÄÄFolder 2
³ ÃÄÄÄSubfolder 1
³ ÃÄÄÄSubfolder 2
³ ÃÄÄÄSubfolder 3
³ ÀÄÄÄSubfolder 4
ÃÄÄÄFolder 3
³ ÃÄÄÄSubfolder 1
³ ÃÄÄÄSubfolder 2
³ ÃÄÄÄSubfolder 3
³ ÀÄÄÄSubfolder 4
ÀÄÄÄFolder 4
ÃÄÄÄSubfolder 1
ÃÄÄÄSubfolder 2
ÃÄÄÄSubfolder 3
ÀÄÄÄSubfolder 4
PS C:powershell>
This is what I get in Powershell:
PS C:powershell> Get-childitem | tree
Folder PATH listing
Volume serial number is XXXX-XXXX
C:.
+---Folder 1
¦ +---Subfolder 1
¦ +---Subfolder 2
¦ +---Subfolder 3
¦ +---Subfolder 4
+---Folder 2
¦ +---Subfolder 1
¦ +---Subfolder 2
¦ +---Subfolder 3
¦ +---Subfolder 4
+---Folder 3
¦ +---Subfolder 1
¦ +---Subfolder 2
¦ +---Subfolder 3
¦ +---Subfolder 4
+---Folder 4
+---Subfolder 1
+---Subfolder 2
+---Subfolder 3
+---Subfolder 4
PS C:powershell>
Interesting point here, but I must say my experience differs - tree output is the same regardless of using console or ISE. Do you have the community extensions installed, or is this using CMD's tree?
– Iszi
Oct 15 '14 at 14:17
add a comment |
Are you running the command in Powershell or Powershell ISE?
There's a difference.
This is what I get in Powershell ISE:
PS C:powershell> Get-ChildItem | tree
Folder PATH listing
Volume serial number is XXXX-XXXX
C:.
ÃÄÄÄFolder 1
³ ÃÄÄÄSubfolder 1
³ ÃÄÄÄSubfolder 2
³ ÃÄÄÄSubfolder 3
³ ÀÄÄÄSubfolder 4
ÃÄÄÄFolder 2
³ ÃÄÄÄSubfolder 1
³ ÃÄÄÄSubfolder 2
³ ÃÄÄÄSubfolder 3
³ ÀÄÄÄSubfolder 4
ÃÄÄÄFolder 3
³ ÃÄÄÄSubfolder 1
³ ÃÄÄÄSubfolder 2
³ ÃÄÄÄSubfolder 3
³ ÀÄÄÄSubfolder 4
ÀÄÄÄFolder 4
ÃÄÄÄSubfolder 1
ÃÄÄÄSubfolder 2
ÃÄÄÄSubfolder 3
ÀÄÄÄSubfolder 4
PS C:powershell>
This is what I get in Powershell:
PS C:powershell> Get-childitem | tree
Folder PATH listing
Volume serial number is XXXX-XXXX
C:.
+---Folder 1
¦ +---Subfolder 1
¦ +---Subfolder 2
¦ +---Subfolder 3
¦ +---Subfolder 4
+---Folder 2
¦ +---Subfolder 1
¦ +---Subfolder 2
¦ +---Subfolder 3
¦ +---Subfolder 4
+---Folder 3
¦ +---Subfolder 1
¦ +---Subfolder 2
¦ +---Subfolder 3
¦ +---Subfolder 4
+---Folder 4
+---Subfolder 1
+---Subfolder 2
+---Subfolder 3
+---Subfolder 4
PS C:powershell>
Interesting point here, but I must say my experience differs - tree output is the same regardless of using console or ISE. Do you have the community extensions installed, or is this using CMD's tree?
– Iszi
Oct 15 '14 at 14:17
add a comment |
Are you running the command in Powershell or Powershell ISE?
There's a difference.
This is what I get in Powershell ISE:
PS C:powershell> Get-ChildItem | tree
Folder PATH listing
Volume serial number is XXXX-XXXX
C:.
ÃÄÄÄFolder 1
³ ÃÄÄÄSubfolder 1
³ ÃÄÄÄSubfolder 2
³ ÃÄÄÄSubfolder 3
³ ÀÄÄÄSubfolder 4
ÃÄÄÄFolder 2
³ ÃÄÄÄSubfolder 1
³ ÃÄÄÄSubfolder 2
³ ÃÄÄÄSubfolder 3
³ ÀÄÄÄSubfolder 4
ÃÄÄÄFolder 3
³ ÃÄÄÄSubfolder 1
³ ÃÄÄÄSubfolder 2
³ ÃÄÄÄSubfolder 3
³ ÀÄÄÄSubfolder 4
ÀÄÄÄFolder 4
ÃÄÄÄSubfolder 1
ÃÄÄÄSubfolder 2
ÃÄÄÄSubfolder 3
ÀÄÄÄSubfolder 4
PS C:powershell>
This is what I get in Powershell:
PS C:powershell> Get-childitem | tree
Folder PATH listing
Volume serial number is XXXX-XXXX
C:.
+---Folder 1
¦ +---Subfolder 1
¦ +---Subfolder 2
¦ +---Subfolder 3
¦ +---Subfolder 4
+---Folder 2
¦ +---Subfolder 1
¦ +---Subfolder 2
¦ +---Subfolder 3
¦ +---Subfolder 4
+---Folder 3
¦ +---Subfolder 1
¦ +---Subfolder 2
¦ +---Subfolder 3
¦ +---Subfolder 4
+---Folder 4
+---Subfolder 1
+---Subfolder 2
+---Subfolder 3
+---Subfolder 4
PS C:powershell>
Are you running the command in Powershell or Powershell ISE?
There's a difference.
This is what I get in Powershell ISE:
PS C:powershell> Get-ChildItem | tree
Folder PATH listing
Volume serial number is XXXX-XXXX
C:.
ÃÄÄÄFolder 1
³ ÃÄÄÄSubfolder 1
³ ÃÄÄÄSubfolder 2
³ ÃÄÄÄSubfolder 3
³ ÀÄÄÄSubfolder 4
ÃÄÄÄFolder 2
³ ÃÄÄÄSubfolder 1
³ ÃÄÄÄSubfolder 2
³ ÃÄÄÄSubfolder 3
³ ÀÄÄÄSubfolder 4
ÃÄÄÄFolder 3
³ ÃÄÄÄSubfolder 1
³ ÃÄÄÄSubfolder 2
³ ÃÄÄÄSubfolder 3
³ ÀÄÄÄSubfolder 4
ÀÄÄÄFolder 4
ÃÄÄÄSubfolder 1
ÃÄÄÄSubfolder 2
ÃÄÄÄSubfolder 3
ÀÄÄÄSubfolder 4
PS C:powershell>
This is what I get in Powershell:
PS C:powershell> Get-childitem | tree
Folder PATH listing
Volume serial number is XXXX-XXXX
C:.
+---Folder 1
¦ +---Subfolder 1
¦ +---Subfolder 2
¦ +---Subfolder 3
¦ +---Subfolder 4
+---Folder 2
¦ +---Subfolder 1
¦ +---Subfolder 2
¦ +---Subfolder 3
¦ +---Subfolder 4
+---Folder 3
¦ +---Subfolder 1
¦ +---Subfolder 2
¦ +---Subfolder 3
¦ +---Subfolder 4
+---Folder 4
+---Subfolder 1
+---Subfolder 2
+---Subfolder 3
+---Subfolder 4
PS C:powershell>
edited Oct 15 '14 at 14:11
Kevin Panko
5,979113648
5,979113648
answered Oct 15 '14 at 13:49
Zeth PalmgrenZeth Palmgren
11
11
Interesting point here, but I must say my experience differs - tree output is the same regardless of using console or ISE. Do you have the community extensions installed, or is this using CMD's tree?
– Iszi
Oct 15 '14 at 14:17
add a comment |
Interesting point here, but I must say my experience differs - tree output is the same regardless of using console or ISE. Do you have the community extensions installed, or is this using CMD's tree?
– Iszi
Oct 15 '14 at 14:17
Interesting point here, but I must say my experience differs - tree output is the same regardless of using console or ISE. Do you have the community extensions installed, or is this using CMD's tree?
– Iszi
Oct 15 '14 at 14:17
Interesting point here, but I must say my experience differs - tree output is the same regardless of using console or ISE. Do you have the community extensions installed, or is this using CMD's tree?
– Iszi
Oct 15 '14 at 14:17
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f745083%2fget-childitem-tree-gives-me-a-wierdly-formatted-tree%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
in powershell type $OutputEncoding and paste the results
– Keltari
Apr 23 '14 at 14:30
See edit in post.
– aPerfectMisterMan
Apr 23 '14 at 14:34
@MHA, please copy the detail into your original post - the post can be edited.
– Dave
Apr 23 '14 at 14:36
It definitely looks like an encoding problem. My tree works and the encoding is us-ascii. IsSingleByte : True BodyName : us-ascii EncodingName : US-ASCII HeaderName : us-ascii WebName : us-ascii WindowsCodePage : 1252 IsBrowserDisplay : False IsBrowserSave : False IsMailNewsDisplay : True IsMailNewsSave : True EncoderFallback : System.Text.EncoderReplacementFallback DecoderFallback : System.Text.DecoderReplacementFallback IsReadOnly : True CodePage : 20127
– Keltari
Apr 23 '14 at 14:40
1
@MHA Does using the ascii switch for tree help?
gci| tree /A– Rynant
Apr 24 '14 at 14:40