We help IT Professionals succeed at work.
Get Started

run powershell code to run EDID info from win xp

1,675 Views
Last Modified: 2012-06-18
Hi,
I`m newbie in powershell world.
I have a code written in powershell.
i`d like to run it in windows xp to get EDID info .
may a help how to do it.
when i run it as powershell pathtothefile.ps1
it gives me error.
when i run it through PowerGUI , it doesn`t return info.
(inside the code there is functions ,which i don`t know hot to output.etc)
link to the code:
http://www.hofferle.com/archives/45
Function Get-MonitorInfo 

{  

    [CmdletBinding()]  

    Param  

    (  

        [Parameter(  

        Position=0,  

        ValueFromPipeLine=$true,  

        ValueFromPipeLineByPropertyName=$true)]  

        [string]$name = '.' 

    )  

   

    Process  

    {  

   

        $ActiveMonitors = Get-WmiObject -Namespace rootwmi -Class wmiMonitorID -ComputerName $name 

        $monitorInfo = @()  

   

        foreach ($monitor in $ActiveMonitors)  

        {  

            $mon = New-Object PSObject  

            $manufacturer = $null 

            $product = $null 

            $serial = $null 

            $name = $null 

            $week = $null 

            $year = $null 

   

            $monitor.ManufacturerName | foreach {$manufacturer += [char]$_}  

            $monitor.ProductCodeID | foreach {$product += [char]$_}  

            $monitor.SerialNumberID | foreach {$serial += [char]$_}  

            $monitor.UserFriendlyName | foreach {$name += [char]$_}  

   

            $mon | Add-Member NoteProperty Manufacturer $manufacturer 

            $mon | Add-Member NoteProperty ProductCode $product 

            $mon | Add-Member NoteProperty SerialNumber $serial 

            $mon | Add-Member NoteProperty Name $name 

            $mon | Add-Member NoteProperty Week $monitor.WeekOfManufacture  

            $mon | Add-Member NoteProperty Year $monitor.YearOfManufacture  

   

            $monitorInfo += $mon 

        }  

        $monitorInfo 

    }  

}

Open in new window

Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE