Ich möchte eine CSV-Datei unter Windows 7 von PowerShell-Skript erstellen. Jetzt habe ichIn der CSV-Datei unter Windows 7 von PowerShell stecken
$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
Nachdem ich den Code lief ich so etwas wie dieses bekam:
"IsReadOnly","IsFixedSize","IsSynchronized","Keys","Values","SyncRoot","Count" "False","False","False","System.Collections.Hashtable+KeyCollection","System.Collections.Hashtable+ValueCollection","System.Object","5"
Aber ich möchte eine richtige CSV-Datei wie folgt:
"Date" "11/3/2017"
Ist es möglich, durch Powershell ?
Ihr Code macht keinen Sinn. '$ dd' enthält immer nur 1 Wert, das aktuelle Datum. – Ashigore