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

Path with single quote and comma

$
0
0

Hi powerShell,

$fileList = dir 'H:\aa.txt','H:\bb.txt'
$newExtension = ".CSV"
$CsvFile = ""
$(foreach ($file in $fileList){
    $CsvFile = ((join-path $file.DirectoryName  $file.BaseName) + $newExtension)
    $CsvFile
})

the output:
H:\aa.CSV
H:\bb.CSV

I want to display output look like this as below:
'H:\aa.CSV','H:\bb.CSV'


Viewing all articles
Browse latest Browse all 6937

Trending Articles