![]() |
|
|
|||||||
| Petri.co.il is happy to award auglan the title of Most Valuable Member !!! |
| Register | Calendar |
Search |
Today's Posts |
Mark Forums Read |
| Notices |
|
|
Need Help Formatting Columns in Excel using Powershell and maybe adding a chart!this thread has 1 replies and has been viewed 1538 times
|
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||||||
|
||||||||
|
Would anyone know how to take my current powershell script which displays server space from a current list of servers into an excel spreadsheet and makes the data autofit into the cells? I would also like to make this script display a chart in Excel as well if possible. Any help would be appreciated.
Code:
$servname = Get-Content c:\FSserv.txt
Get-WmiObject win32_logicalDisk -ComputerName $servname | Where-Object {$_.VolumeName -like "JH*R*"} | select-object `
DeviceID,VolumeName, `
@{label="Size";Expression={"{0:n2}" -f ($_.Size/1GB)}},
@{label="FreeSpace";Expression={"{0:n2}" -f ($_.FreeSpace/1GB)}},
@{label="%Free";Expression={"{0:p2}" -f ($_.FreeSpace/$_.Size)}} | Export-CSV c:\jhFSfreespace.csv -NoTypeInformation
Last edited by Rems; 27th March 2012 at 14:37.. Reason: added CODE-tags |
|
#2
|
||||||||
|
||||||||
|
Did you manage to write the code? I might have it if you still need help.
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| powershell script and CSV formatting | s_anr | Powershell | 3 | 14th August 2009 10:58 |
| Excel 2000 conditional formatting quandry | Nonapeptide | Office XP / 2003 General Issues | 2 | 24th September 2008 05:42 |
| VBScript - String Formatting (output in to columns) | humbletech99 | General Scripting | 3 | 7th January 2008 12:04 |
| Import columns from .csv file to Excel SS | dman4u2no | General Scripting | 1 | 11th December 2007 01:45 |
| Adding columns to 'Select Names' dialog | Pjotr | Outlook XP/2003/2007 | 1 | 8th March 2007 17:50 |