Need Help with Powershell Advance Function

Hi , I’m new to Powershell and I’m working on script to gather some hardware information .
Script works fine only for single computer but is coming up with an error when I’m trying to get information’s from multiple remote computers .

Method invocation failed because [System.Object] doesn’t contain a method named ‘op_Division’.
At C:\HwInfops1.ps1:46 char:2

  • $HWHashTabel =[ordered]@{
  •  + CategoryInfo          : InvalidOperation: (op_Division:String) [], RuntimeException
     + FullyQualifiedErrorId : MethodNotFound
    
    

param (
[Parameter(Mandatory=$true)]
[string]$computername
)

I have Parameter $computername set to accept multiple computers .
Can anyone help me please .
Script is attached as TXT file .

you will need a loop.

either
foreach($computer in $computername)
{
$BIOS = Get-WmiObject win32_bios -computername $computer


$HDDinfo
}

or

$computername | foreach-object {
$BIOS = Get-WmiObject win32_bios -computername $_


$HDDinfo
}

Kevin

Thank you Kevin . That solved the issue .