How to generify a Collection of Foo?

Hi! I'm about to convert some legacy code to use generics. However, i'm puzzled by the following piece of code (out of my memory so please bear with me):
public SomeClass {
  public static void doSomething(Collection foos) {
    for (Iterator it = foos.iterator(); it.hasNext();) {
      Foo foo = (Foo) it.next();
      foo.doSomething();
}I have tried to change this to:
public SomeClass {
  public static void doSomething(Collection<Foo> foos) {
    for (Foo foo : foos) {
      foo.doSomething();
}Looks ok to me. However, i found the following uses of the method:
public class Bar extends Foo {
  public void doIt() {
    List bars = // create List of Bar...
    SomeClass.doSomething(bars);
}I was thinking of using Collection<? extends Foo> as parameter for SomeClass.doSomething, but will this work for Lists (or Sets)?
I'm thankful for any advice.
Markus

Howlingmad wrote:
public class Bar extends Foo {
public void doIt() {
List bars = // create List of Bar...
SomeClass.doSomething(bars);
Be sure to keep that List generic as well!
I was thinking of using Collection<? extends Foo> as parameter for SomeClass.doSomething, yes, you are on the right track. It should be like this:
class SomeClass {
    public static void doSomething(Collection<? extends Foo> foos) {
        for (Foo foo : foos) {
            foo.doSomething();
class Foo {
    void doSomething() {}
class Bar extends Foo {
    void doIt() {
        List<Bar> bars = new ArrayList<Bar>();
        SomeClass.doSomething(bars);
but will this work for Lists (or Sets)?Yes, it will work for any type of Collection of Foo's (a Bar is also a Foo, of course).
I'm thankful for any advice.
Markus

Similar Messages

  • I have a CD burner yet I cannot burn or copy on CD from my collection. When I click on File - burn to CD I get:"To burn to CD you require a CD writer -  Please advise how to burn a collection on a CD Thank you Diane

    Please advise how to burn a collection on a CD - When I click on File then burn to CD - I get:To burn CD you require a CD writer  yet I have one -  which I have used many times with another package.  Also where are the pictures that I have put into a collection stored?  I cannot find them.  I can display them so they have to be stored somewhere in a file or folder etc...I am retired and very new at using this Adobe photoshop edition 3.2  Thank you for your help I am desperate.

    Once the tracks are in your library, you can right-click and use the command Get Album Artwork.  This command will attempt to match your track(s) to the item in the iTunes Store, and get the cover art.
    If that command does not succeed, you will need a copy of the art in .JPG format, either by scanning your CD cover, or by getting it from the web.  Once you have the art, right-click the track, choose Get Info, go the Artwork tab and paste it in.

  • How to release a collective production order in CO05N with MSPT?

    The issue was: I want to release a collective order by co05n, e.g. the structure of this collective production order 10000 like this:
    10000----20000
    30000---40000
                                 ---50000
    if order 50000 with material shortage, keep the customizing OPJK  release order=3, how to release this collective
    order. If it is not possible in standard, can the parallel order 40000 be released??
    Thank you, all.
    Edited by: Stephen Wang on Apr 15, 2010 3:12 PM

    Dear,
    In Transaction CO05N, you execute a collective release. For one of the orders, the availability check determines missing part although it has been set in Customizing of the availability check (OPJK) that a release can be executed for missing part per user decision. Therefore, a dialog box is processed on which options a.) 'Release order', b.) 'Missing parts list' and c.) 'Cancel' are displayed.
    If you first branch to the missing parts list and then press 'Cancel' on the dialog box there it self
    Else you can do this with these options,
    1)Use T Code COHVOMRELEASE here select order as you want and release accordingly.
    2) Use Transaction SE38 to create the variants for program PPIO_ENTRY and schedule it through SM36 or use standard variant as SAP&RELEASE if want in background.
    3) use BAPI BAPI_PRODORD_RELEASE
    Please try and come back.
    Regards,
    R.Brahmankar

  • How to use a collection in ADF

    Hi all,
    How to use the collection in ADF.
    Thanks in advance
    C.Karukkuvel

    hi John,
    Scenario:
    In my page,i have two tab pages .In that when the user enter the Location names in the first tab.when the user navigates to the next tab,we need to give the LOV having the Loactions based on the first tab values.
    when i try to use the view object it will list only the data's in the database.but i needs the locations entered in the current page also.pls guide me in this
    Thanks & Regards
    C.Karukkuvel

  • XCode: how to add bison (yacc) "-p foo" for a SINGLE .ym file?

    I have two pairs of tokenizers (.lm) and parsers (.ym) I want to use in pairs.
    How do i add the -p "foo" option for a single file? And "-P foo" for (f)lex?
    (I can add options at the target level, that much I know...)

    Thanks.
    For some reason, the "build" pane is not present in a framework target. I had to move the .ym and .lm files to my Application target before it became visible.
    Another funny thing XCode does with the extra yacc or lex parameters is to pass them on to gcc when compiling the generated c file. So you also have to create empty files named for each prefix, or the compiler will choke.

  • How do you move collections from Photoshop Elements 5.0 to Photoshop Elements 13?

    I have an old laptop with Photoshop elements 5.0 and wanted to move that program to my newer PC but the program was too old so I bought and loaded Photoshop Elements 13 on my PC.  To import my photos from the 5.0 I did a full backup on a flash drive and then loaded the pictures to the PC with 13.  The pictures are there but none of my collections from 5.0. I read the manual and said I was supposed to be prompted to convert old catalogs.  I was never prompted and do not know how to transfer my collections in my catalog from 5.0 to the 13.

    helpmepleaze a écrit:
    I have an old laptop with Photoshop elements 5.0 and wanted to move that program to my newer PC but the program was too old so I bought and loaded Photoshop Elements 13 on my PC.  To import my photos from the 5.0 I did a full backup on a flash drive and then loaded the pictures to the PC with 13.  The pictures are there but none of my collections from 5.0. I read the manual and said I was supposed to be prompted to convert old catalogs.  I was never prompted and do not know how to transfer my collections in my catalog from 5.0 to the 13.
    What you are doing is not only to install a newer version of PSE, it's also to migrate to a new computer.
    The general solution is to do a full organizer backup on an external drive and do an organizer restore to the new computer (or new drive).
    Use Backup, Restore to move catalog | Organizer | Elements 6 or later
    The problem is that since PSE5 is an old version working with a different database engine, you must first use a conversion utility to create a PSE13 version.
    http://helpx.adobe.com/elements-organizer/kb/convert-organizer-catalog-elements-13-64.html
    So read that paper carefully, do the backup restore and conversion as described.

  • How do I delete collections from iphone

    how do I delete collections on my iphone

    If in the"Collections" view where you see all of the photos categorized in a range of dates, tap on any of those photos and you will now be in "Moments" view. Tap the Select button in the upper right corner and then tap on every photo that you want to delete. Tap the trash can icon in the upper left to delete the photos. The photos will go to "Recently Deleted" album for 30 days after which time they will be removed from your phone unless you delete them first.

  • How to sort a collection by two componets/Attributes

    Hello All,
    Scenario:
    I have a result table view with columns Contact Person Number, Central Block flag and Last name. At the instance of BP confirmation in IC this result table(result view displays the contact persons associated with the account id during the BP cofirmation) is filled in a sorted order based on the Contact Person Number.
    Requirement:
    Sort the result table by Central block flag followed by Contact Last Name.Hence how to sort the collection of the result table view based on two attributes Central Block and Last Name?
    Looking forward for your support.
    Regards,
    Harish P M

    Hello Harish,
    Good question. The framework doesn't seem to support this. When i needed this functionality, i had to create my own implementation of collection. You can inherit from CL_CRM_BOL_ENTITY_COL and overwrite several methods which do the sorting. Check the class CL_CRM_IPM_RAA_BOL_COL.
    Best Regards,
    Yevgen

  • How to build a collection based on the installed definition update version

    Well I would like to know how to crate the collection of those clients are only installed the definition update? for example, KB2461484
    or
    Definition Update for Microsoft Endpoint Protection -KB2461484 (Definition 1.169.2635.0)"

    thaks Sherry. I got the query:
    Query1: via KB title
    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner
    join SMS_G_System_PatchStatusEx on SMS_G_System_PatchStatusEx.ResourceId = SMS_R_System.ResourceId where SMS_G_System_PatchStatusEx.Title  =
    "Definition Update for Microsoft Endpoint Protection - KB2461484 (Definition 1.169.2635.0)" and LastStateName =
    "Install Verified"
    Query2: via KB number
    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner
    join SMS_G_System_PatchStatusEx on SMS_G_System_PatchStatusEx.ResourceId = SMS_R_System.ResourceId where SMS_G_System_PatchStatusEx. QNumbers   = =
    "2461484" and LastStateName =
    "Install Verified"

  • SCCM 2012- How to limit a collection membership only for specific count of machines

    How to limit a collection membership only for specific count of machines

    As I said you can use where SMS ID like %1 and see how many machines that gets you. If it's not enough do where SMS ID like %1 or SMS ID like %2. Keep adding a digit until you get ~5000. It won't be perfect though.
    John Marcum | http://myitforum.com/myitforumwp/author/johnmarcum/

  • How to move persona collection in add-ons to persona favorites

    how to move Personas collection from add-ons page to favorites on the Persoans page.

    Maybe try to ask advice at the Personas forum: https://forums.mozilla.org/addons/viewforum.php?f=30

  • How to invoice on collective contract account?

    HI,
    Can any one please let me know how to invoice on collective contract account level. I am new to this concept, at the individual contract account level the billing is happening but when we do on collective contract level, getting an error as there is no contract to the collective contract account.?
    Please reply as soon as possible as it is very urgent.
    Regards,
    Moin

    Moin:
    Please read the Research Resources and Rules of Engagement  and then search the available resources before posting basic questions about functionality. There is plenty of information available about the collective invoice process in the help (and previous threads) - this thread is locked.
    regards,
    bill.

  • How to get a collection of beans using web services

    Hi,
    I'm new to SOAP and Web Services I'd like to know whether the following is possible
    or not.
    I've created an EJB with this business interface:
    public interface Users implements EJBObject {
    public User[] getUsers( ) ...
    Where the User object is a bean with some properties:
    public User implements Serializable {
    public void setName( ... ) ...
    public String getName( ) ...
    public void setAddress( ... ) ...
    public String getAdress( ) ...
    I've create the ejb-jar.xml and weblogic-ejb-jar.xml that contain the definition
    of my EJB and then I try to deploy the web services using the ant task 'wsgen'.
    I get the following exception:
    org.xml.sax.SAXException: Could not find a codec that understood how to convert
    class [LUser; using http://schemas.xmlsoap.org/soap/encoding/
    : [ CodecFactory: http://xml.apache.org/xml-soap/literalxml=null, http://schemas.xmlsoap.org/soap/encoding/=null,
    =null]
    Can someone help to resolve this ? Also, I'd like to know if it's possible that
    a web service return a collection of beans as shown above ?
    Thanks for your help.
    Ludovic.

    Java beans are serialized/deserialized by the soap encoding codec
    itself. you dont have to write custom encoders. I think the error
    is because you dont have the java bean class on the server side.
    Java bean class file should be in the classpath or it should be
    added to the ejb jar file.
    thanks,
    -manoj
    Ludovic Deravet wrote:
    Thanks for your help. Indeed, that was my problem.
    But now I'm facing this one:
    [SOAPException: faultCode=SOAP-ENV:Client; msg=No Deserializer found to
    deserialize a 'urn:local:ns0:return' using encoding style 'http://sch
    emas.xmlsoap.org/soap/encoding/'.;
    targetException=java.lang.IllegalArgumentException: No Deserializer found to
    deserialize a 'urn:local:ns0:
    return' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'.]
    at org.apache.soap.rpc.Call.invoke(Call.java:246)
    at com.webservices.WSClient.main(WSClient.java:38)
    Did you implement your own deserializer to read your array of beans (called
    Data) ? Or do I need to do something else ?
    Thanks.
    Ludovic.
    "manoj cheenath" <[email protected]> wrote in message
    news:[email protected]...
    You can do this. I guess, the problem is because you have
    not defined a package for the bean.
    Try something like:
    package foo.bar;
    class User{
    I am attaching an example.
    -manoj
    Ludovic Deravet wrote:
    Hi,
    I'm new to SOAP and Web Services I'd like to know whether the following
    is possible
    or not.
    I've created an EJB with this business interface:
    public interface Users implements EJBObject {
    public User[] getUsers( ) ...
    Where the User object is a bean with some properties:
    public User implements Serializable {
    public void setName( ... ) ...
    public String getName( ) ...
    public void setAddress( ... ) ...
    public String getAdress( ) ...
    I've create the ejb-jar.xml and weblogic-ejb-jar.xml that contain thedefinition
    of my EJB and then I try to deploy the web services using the ant task'wsgen'.
    I get the following exception:
    org.xml.sax.SAXException: Could not find a codec that understood how toconvert
    class [LUser; using http://schemas.xmlsoap.org/soap/encoding/
    : [ CodecFactory: http://xml.apache.org/xml-soap/literalxml=null,
    http://schemas.xmlsoap.org/soap/encoding/=null,> > > =null
    Can someone help to resolve this ? Also, I'd like to know if it's
    possible that
    a web service return a collection of beans as shown above ?
    Thanks for your help.
    Ludovic.

  • How to display data collected in main vi to indicators in another vi

    Hi,
    I am collecting data using NI 6251 USB DAQ
    in the main vi but as i have too many controls and indicators on the
    main vi front panel. so i want to display the indicators(graphs) in another vi. i also
    want the vi with the graphs to open automatically. Does any one know how
    i can do this? I would
    really appreciate any help.
    Thanks,
     ygupta
    Solved!
    Go to Solution.

    Hi,
    Search forum for the sub vi concept.
    For your reference i have attached a example.
    you can see procedure for the same on the net.
    regards,
    Shrek
    Attachments:
    graph.zip ‏11 KB

  • How to create an collection/array/object/thingy from a bunch of objects for eventual export to CSV.

    This is a follow-up to an earlier post (How
    to output a bunch of variables into a table.) Now that I can ouput data for a single computer I need to to do the same for a list of computers into a CSV. In more general terms how do I get a bunch of $Computer objects into a single collection/array/object/thingy
    with a clever name like $Computers?
    # http://ss64.com/ps/get-wmiobject-win32.html
    # http://social.technet.microsoft.com/Forums/en-US/da54b6ab-6941-4e45-8697-1d3236ba2154/powershell-number-of-cpu-sockets-wmi-query?forum=winserverpowershell
    # http://serverfault.com/questions/10328/determine-cpu-processors-vs-sockets-though-wmi
    # http://social.technet.microsoft.com/Forums/windowsserver/en-US/8443fcfd-5a0b-4c3d-bda7-26df83d2ee92/how-to-output-a-bunch-of-variables-into-a-table?forum=winserverpowershell
    Param(
    [Parameter(Mandatory=$false,ValueFromPipeline=$true)]
    [string]$ComputerName = $env:COMPUTERNAME,
    [Parameter(Mandatory=$false,ValueFromPipeline=$false)]
    [ValidateScript(
    If ( $_ -ne $null ) { Test-Path $_ }
    [String]$ComputerListFile
    Function Get-Computer
    Param(
    [string]$ComputerName
    $Win32_PingStatus = $null
    $Win32_PingStatus_Result = $null
    $Win32_OperatingSystem = $null
    $Win32_Processor = $null
    $Win32_PhysicalMemory = $null
    $Win32_ComputerSystem = $null
    $Win32_BIOS = $null
    $Computer = $null
    $Win32_PingStatus = "select * from Win32_PingStatus where address = '$ComputerName'"
    $Win32_PingStatus_Result = Get-WmiObject -query $Win32_PingStatus
    If ( $Win32_PingStatus_Result.protocoladdress )
    "$ComputerName ping succeeded."
    $Win32_OperatingSystem = Get-WmiObject Win32_OperatingSystem -computer $ComputerName -ErrorAction SilentlyContinue
    If ( $Win32_OperatingSystem -eq $null)
    "$ComputerName WMI failed."
    } Else {
    "$ComputerName WMI succeeded."
    $Win32_Processor = [object[]]$(Get-WmiObject Win32_Processor -computer $ComputerName)
    $Win32_PhysicalMemory = [object[]]$(Get-WmiObject Win32_PhysicalMemory -computer $ComputerName)
    $Win32_ComputerSystem = Get-WmiObject Win32_ComputerSystem -computer $ComputerName
    $Win32_BIOS = Get-WmiObject Win32_BIOS -computer $ComputerName
    $Computer = New-Object -Type PSObject -Property @{
    Name = $Win32_OperatingSystem.CSName
    Win32_BIOS_SerialNumber = [string]$Win32_BIOS.SerialNumber
    Win32_ComputerSystem_Manufacturer = [string]$Win32_ComputerSystem.Manufacturer
    Win32_ComputerSystem_Model = [string]$Win32_ComputerSystem.Model
    #Win32_ComputerSystem_NumberOfLogicalProcessors = [int32]$Win32_ComputerSystem.NumberOfLogicalProcessors
    #Win32_ComputerSystem_NumberOfProcessors = [int32]$Win32_ComputerSystem.NumberOfProcessors
    Win32_ComputerSystem_TotalPhysicalMemory = [long]$Win32_ComputerSystem.TotalPhysicalMemory
    Win32_ComputerSystem_TotalPhysicalMemory_GB = [float]($Win32_ComputerSystem.TotalPhysicalMemory / (1024*1024*1024))
    Win32_OperatingSystem_Caption = [string]$Win32_OperatingSystem.Caption
    Win32_OperatingSystem_CSName = [string]$Win32_OperatingSystem.CSName
    #Win32_OperatingSystem_OSArchitecture = [string]$Win32_OperatingSystem.OSArchitecture
    #Win32_OperatingSystem_SerialNumber = [string]$Win32_OperatingSystem.SerialNumber
    Win32_OperatingSystem_ServicePackVersion = [string]$Win32_OperatingSystem.ServicePackMajorVersion + "." + [string]$Win32_OperatingSystem.ServicePackMinorVersion
    Win32_PhysicalMemory_Capacity = ($Win32_PhysicalMemory | ForEach-Object { $_.Capacity } | Measure-Object -Sum).sum
    Win32_PhysicalMemory_Capacity_GB = (($Win32_PhysicalMemory | ForEach-Object { $_.Capacity } | Measure-Object -Sum).sum / (1024*1024*1024))
    Win32_Processor_Count = [int]$Win32_Processor.Count
    Win32_Processor_NumberOfCores = [string]$Win32_Processor[0].NumberOfCores
    Win32_Processor_NumberOfLogicalProcessors = [string]$Win32_Processor[0].NumberOfLogicalProcessors
    #Win32_Processor_Description = [string]$Win32_Processor[0].Description
    Win32_Processor_Manufacturer = [string]$Win32_Processor[0].Manufacturer
    Win32_Processor_Name = [string]$Win32_Processor[0].Name
    } ## end new-object
    $Computer
    } Else {
    "$ComputerName ping failed."
    $ComputerNameMgmt = $ComputerName + "-mgmt"
    $Win32_PingStatus = "select * from Win32_PingStatus where address = '$ComputerNameMgmt'"
    $Win32_PingStatus_Result = Get-WmiObject -query $Win32_PingStatus
    If ( $Win32_PingStatus_Result.protocoladdress )
    "$ComputerNameMgmt ping succeded."
    } Else {
    "$ComputerNameMgmt ping failed."
    "$(Get-Date -Format o) Starting script $($MyInvocation.MyCommand.Name)"
    If ( $ComputerListFile -eq $null -or $ComputerListFile.Length -eq 0 )
    "Processing computer $ComputerName"
    Get-Computer( $ComputerName )
    } Else {
    "Processing computer list $ComputerList"
    $ComputerList = Get-Content $ComputerListFile
    $Computers = @{}
    $Results = @()
    ForEach( $ComputerListMember in $ComputerList )
    "$(Get-Date -Format o) $ComputerListMember"
    # Get-Computer( $ComputerListMember ) | Add-Member -InputObject $Computers -MemberType NoteProperty -Name $_
    # http://social.technet.microsoft.com/Forums/windowsserver/en-US/e7d602a9-a808-4bbc-b6d6-dc78079aafc9/powershell-to-ping-computers
    # $Compuers += New-Object PSObject -Property $Props
    # $Computers += New-Object PSObject -Property Get-Computer( $ComputerListMember )
    Get-Computer( $ComputerListMember )
    "$(Get-Date -Format o) Ending script $($MyInvocation.MyCommand.Name)"
    If I try something like this:
    Get-Computer( $ComputerListMember ) | Add-Member -InputObject $Computers -MemberType NoteProperty -Name $_
    I get the following, even though $_.Name is not null.
    Add-Member : Cannot bind argument to parameter 'Name' because it is null.
    At <path to my script>Get-Hardware_Memory_OSVersion_CPU_Cores_ver04_sanitized.ps1:111 char:107
    + Get-Computer( $ComputerListMember ) | Add-Member -InputObject $Computers -MemberType NoteProperty -Name <<<< $_
    + CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
    Or if I try this:
    $Computers += New-Object PSObject -Property Get-Computer( $ComputerListMember )
    I get this:
    New-Object : Cannot bind parameter 'Property'. Cannot convert the "Get-Computer" value of type "System.String" to type "System.Collections.Hashtable".
    At <path to my script>Get-Hardware_Memory_OSVersion_CPU_Cores_ver04_sanitized.ps1:114 char:47
    + $Computers += New-Object PSObject -Property <<<< Get-Computer( $ComputerListMember )
    + CategoryInfo : InvalidArgument: (:) [New-Object], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.NewObjectCommand

    Hi Aenagy,
    If you want to combine all the computers' information to a single array, and add the property computername in the output, please also try the script below, which I make a little modification of the function Get-Computer, pleaese make sure the account running
    the script has the admin permission of the remote computers, or you need to privide cridentials in get-wmiobject, also note I haven't tested:
    $output = @()#to output information of the all the computers
    ForEach( $ComputerName in $ComputerList ){#loop all the computers
    $Win32_PingStatus = "select * from Win32_PingStatus where address = '$ComputerName'"
    $Win32_PingStatus_Result = Get-WmiObject -query $Win32_PingStatus
    If ( $Win32_PingStatus_Result.protocoladdress )
    "$ComputerName ping succeeded."
    $Win32_OperatingSystem = Get-WmiObject Win32_OperatingSystem -computer $ComputerName -ErrorAction SilentlyContinue
    If ( $Win32_OperatingSystem -eq $null)
    "$ComputerName WMI failed."
    Else {
    "$ComputerName WMI succeeded."
    $Win32_Processor = [object[]]$(Get-WmiObject Win32_Processor -computer $ComputerName)
    $Win32_PhysicalMemory = [object[]]$(Get-WmiObject Win32_PhysicalMemory -computer $ComputerName)
    $Win32_ComputerSystem = Get-WmiObject Win32_ComputerSystem -computer $ComputerName
    $Win32_BIOS = Get-WmiObject Win32_BIOS -computer $ComputerName
    $Computer = New-Object -Type PSObject -Property @{
    Computername = $ComputerName #add the property computername
    Name = $Win32_OperatingSystem.CSName
    Win32_BIOS_SerialNumber = [string]$Win32_BIOS.SerialNumber
    Win32_ComputerSystem_Manufacturer = [string]$Win32_ComputerSystem.Manufacturer
    Win32_ComputerSystem_Model = [string]$Win32_ComputerSystem.Model
    #Win32_ComputerSystem_NumberOfLogicalProcessors = [int32]$Win32_ComputerSystem.NumberOfLogicalProcessors
    #Win32_ComputerSystem_NumberOfProcessors = [int32]$Win32_ComputerSystem.NumberOfProcessors
    Win32_ComputerSystem_TotalPhysicalMemory = [long]$Win32_ComputerSystem.TotalPhysicalMemory
    Win32_ComputerSystem_TotalPhysicalMemory_GB = [float]($Win32_ComputerSystem.TotalPhysicalMemory / (1024*1024*1024))
    Win32_OperatingSystem_Caption = [string]$Win32_OperatingSystem.Caption
    Win32_OperatingSystem_CSName = [string]$Win32_OperatingSystem.CSName
    #Win32_OperatingSystem_OSArchitecture = [string]$Win32_OperatingSystem.OSArchitecture
    #Win32_OperatingSystem_SerialNumber = [string]$Win32_OperatingSystem.SerialNumber
    Win32_OperatingSystem_ServicePackVersion = [string]$Win32_OperatingSystem.ServicePackMajorVersion + "." + [string]$Win32_OperatingSystem.ServicePackMinorVersion
    Win32_PhysicalMemory_Capacity = ($Win32_PhysicalMemory | ForEach-Object { $_.Capacity } | Measure-Object -Sum).sum
    Win32_PhysicalMemory_Capacity_GB = (($Win32_PhysicalMemory | ForEach-Object { $_.Capacity } | Measure-Object -Sum).sum / (1024*1024*1024))
    Win32_Processor_Count = [int]$Win32_Processor.Count
    Win32_Processor_NumberOfCores = [string]$Win32_Processor[0].NumberOfCores
    Win32_Processor_NumberOfLogicalProcessors = [string]$Win32_Processor[0].NumberOfLogicalProcessors
    #Win32_Processor_Description = [string]$Win32_Processor[0].Description
    Win32_Processor_Manufacturer = [string]$Win32_Processor[0].Manufacturer
    Win32_Processor_Name = [string]$Win32_Processor[0].Name
    } ## end new-object
    $output+=$Computer #combine all the "$computer" to "$output"
    Else {
    "$ComputerName ping failed."
    $output
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna
    TechNet Community Support

Maybe you are looking for

  • Berkeley  DB JE is getting hanged while calling environment sync method.

    Hi, I am developing an application in Java and I am using JE edition of Berkeley. I am facing an issue, during shutdown operation I am calling syn method of EntityStore class and Environment class. The EntityStore.sync() is getting completed but duri

  • POSTING_ILLEGAL_STATEMENT in MIGO for collective slip

    Hi all. I am using smartforms for printing GI slips in MIGO. The problem is that when i want to print the document for collective slip i get a short dump with error: POSTING_ILLEGAL_STATEMENT. I have looked over the internet for a solution but i coul

  • I can't find anything backed up in Mail !

    Hello, I open mail, then I hit time machine and I can't find anything backed up! But I can see (and restore) all data backed up since april 2010 when I started using Time Machine. Any Ideas? tks Wagner

  • Username and Password for access apex 4.2

    Hello, I have installed apex 4.2. Then i have execute java -jar apex.war to instlla listener Then i have execute http://localhost:7779/apex at this point the server ask Autentication Required The server http://localhost:7779/apex requires a username

  • Creating Frames in iWeb

    I creating websites on iWeb, my client has asked if I can create what is essentially a frame. I never have really worked with frames before, and was wondering if it is at all possible to create on in iWeb. I may not use it at all, but I would like to