This project is read-only.

Adding date to my out in this below ps script

Oct 6, 2014 at 9:52 PM
Hello Friends,
Can you please help me with getting the current date when i run the below script?

PS C:\Windows> foreach ($Server in (Get-Content C:\psfiles\Winservers.txt)){Get-WmiObject win32_logi
calDisk -ComputerName $Server| Select @{Expression={$Server};label="ServerName"},DeviceID,Volumename ,@{Expression={$_.Size /1Gb -as [int]};Label="Total Size(GB)"},@{Expression={($_.Size /1Gb -as [int]
) - ($_.Freespace/ 1Gb -as [int])};Label="InUse Size (GB)"} ,@{Expression={$_.Freespace / 1Gb -as [i
nt]};Label="FreeSize (GB)"},@{Expression={(($_.Freespace /1Gb -as [float]) / ($_.Size / 1Gb -as [flo
at]))*100};Label="FreeSpace (%)"},$(Get-Date -format 'd') | format-table

right now..i get
servername deviceid volumename totalsize............10/6/2014
srv1 c: data 100
srv2 d: bkup 50

I want to get the result as

servername deviceid volumename totalsize............createdt
srv1 c: data 100 10/16/2014
srv2 d: bkup 50 10/6/2014.

Thanks In Advance!
Oct 6, 2014 at 11:04 PM
This is not a general-purpose PowerShell help desk. I would recommend posting this question to