Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Directory Name

$
0
0

hi PowerShell,

Here is my sample script as below:

$csvs = Get-ChildItem 'H:\Test1\aa.txt', 'H:\Test1\folder1\bb.txt' -Include *.txt
$newExtension = ".xlsx"
foreach ($csv in $csvs)
{
   How to get Directory name without file name?
}

e.g

H:\Test1\
H:\Test1\folder1\

Any Idea?

Thanks


Viewing all articles
Browse latest Browse all 6937

Trending Articles