akkmuthu Posted August 8, 2007 Report Share Posted August 8, 2007 I have powerShell script to get collection of sites and foramting the collection by using Format-table If I run using PowerShell, working fine. The same thing is working when I give "Test" from PowerGadgets". But after giving finish am getting " No Data Available" screen. My script : ============= [Microsoft.SharePoint.Administration.SPWebApplicationCollection]$SPWebAppCollection = $oContentService.WebApplications; $SPWebAppCollection| Format-Table -autosize -property Name Please help me on this. Thanks in advance. -Andamuthu K Link to comment Share on other sites More sharing options...
marco.shaw Posted August 8, 2007 Report Share Posted August 8, 2007 I don't have SharePoint right now to test, but could possibly get a virtual machine copy. What are the exact PowerShell commands you are running that are failing? Link to comment Share on other sites More sharing options...
akkmuthu Posted August 8, 2007 Author Report Share Posted August 8, 2007 My script : # Assembly References[void][system.Reflection.Assembly]::LoadWithPartialName("System") [void][system.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") # *****************************************************************************# Function: Get-SiteCollection # Description: Populates all the site details of a webfarm.# Parameters: None # *****************************************************************************function Get-SiteCollection() { # Getting Content Service of current web farm $oContentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService; # Getting all the web applications as collection [Microsoft.SharePoint.Administration.SPWebApplicationCollection]$SPWebAppCollection = $oContentService.WebApplications; $SPWebAppCollection| Format-Table -autosize -property Name} #Calling main function Get-SiteCollection Link to comment Share on other sites More sharing options...
marco.shaw Posted August 8, 2007 Report Share Posted August 8, 2007 I'm assuming here that you are using Creator, and are cutting and pasting this script into the script window? The use of format-table cmdlet seems to change the object structure passed along the PowerShell pipeline. I started downloading a pre-built SharePoint VM, but my connection reset and I lost what I had so far. The VM is huge, and there's no way I will be able to get it before Friday. A few things to try: 1. I'd like to see what '$SPWebAppCollection|get-member' gives from your script. 2. Try removing format-table from the pipline to see what that might give. Link to comment Share on other sites More sharing options...
akkmuthu Posted August 8, 2007 Author Report Share Posted August 8, 2007 Hi, It is Collection of Sites and properites. I want only some selected fields from that. If I remove "Format-table", it will return all the properties Link to comment Share on other sites More sharing options...
marco.shaw Posted August 8, 2007 Report Share Posted August 8, 2007 Are you using the PowerGadgets Creator or are doing this directly from PowerShell. From the Creator, you will be able to pick what properties to create the chart with, and from PowerShell, you should be able to use the select-object to limit what properties you want to see in the resulting chart. Link to comment Share on other sites More sharing options...
akkmuthu Posted August 8, 2007 Author Report Share Posted August 8, 2007 I want to use Name and version from that colection. Link to comment Share on other sites More sharing options...
marco.shaw Posted August 8, 2007 Report Share Posted August 8, 2007 I'm sorry, I need more information on whether you're using the GUI ("PowerGadgets Creator") or PowerShell directly. How were you wanting to layout the name and the version? Name on the X axis and version on the Y axis? Link to comment Share on other sites More sharing options...
JuanC Posted August 8, 2007 Report Share Posted August 8, 2007 Please note that our charts require at least one numerical column so if your Name and Version properties are both string I am afraid we will not know how to plot 1.0 or 2.0.5 Theoretically you could write a script to translate 2.0.5 into numbers (e.g. 205) but I am not sure how good this will look. JuanC Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.