PowerShellスクリプトでWindows 7にCSVファイルを作成します。今、私はこのようなものだコード走った後、私はPowerShellでWindows 7のCSVファイルに詰まった
$dd = @(Get-Date -Format d)
$report = @()
$index = 0
foreach ($Item in $dd) {
[array]$report += [PSCustomObject]@{
Date = $dd[$index]
}
$index++
}
$report | Export-Csv -Path "C:\Users\Abby\Desktop\test.txt" -NoTypeInformation
あります
"IsReadOnly","IsFixedSize","IsSynchronized","Keys","Values","SyncRoot","Count" "False","False","False","System.Collections.Hashtable+KeyCollection","System.Collections.Hashtable+ValueCollection","System.Object","5"
をしかし、私はこのような適切なCSVファイルたい:
"Date" "11/3/2017"
は、PowerShellのことで、それは可能です?
あなたのコードは意味がありません。 '$ dd'は現在の日付である1つの値しか含みません。 – Ashigore