Reputation: 243
I am trying to create one folder named test_20131001 like today's date.
$today = (get-date).Date
$dateStr = '{0:yyyyMMdd}' -f $today
New-Item C:\Desktop\Access\test_$dateStr
But every time I run this script, This gives me:
type:
I don't know why this is asking type:? and I am not sure this is correct way of doing this.
Upvotes: 0
Views: 2073
Reputation: 1108
The new item type parameter is missing. Try this:
New-Item C:\Desktop\Access\test_$dateStr -ItemType directory
Upvotes: 1