Petri.co.il forums Home Forums Start Page Forums Frequently Asked Questions FAQ Member List Members List
Go Back   Petri IT Knowledgebase Forums > Windows Scripting > PowerShell
Petri.co.il is happy to award RicklesP the title of Most Valuable Member !!!
Register Calendar Calendar Search Petri IT Knowledgebase Forums Search Todays Posts Today's Posts Mark Forums Read
Notices

Need Help Formatting Columns in Excel using Powershell and maybe adding a chart!

Need Help Formatting Columns in Excel using Powershell and maybe adding a chart!

this thread has 1 replies and has been viewed 1942 times

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 26th March 2012, 16:03
dave918 dave918 is offline
Casual
Casual
 
 Join Date: Mar 2012
  6 month star 12 month star
 Posts: 1
 Reputation: dave918 is on a distinguished road (10)
Question Need Help Formatting Columns in Excel using Powershell and maybe adding a chart!

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  
Old 25th April 2012, 07:51
ronitharebello ronitharebello is offline
Casual
Casual
 
 Join Date: Apr 2011
  6 month star 12 month star
 Posts: 5
 Reputation: ronitharebello is on a distinguished road (10)
Default Re: Need Help Formatting Columns in Excel using Powershell and maybe adding a chart!

Did you manage to write the code? I might have it if you still need help.
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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 1 8th March 2007 17:50


All times are GMT +3. The time now is 00:35.

Steel Blue 3.5.4 vBulletin Style ©2006 vBEnhanced
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
 

Valid XHTML 1.0!   Valid CSS!

Copyright 2005 Daniel Petri