# Get-VHD works localy but not remotely

**URL:** <https://forums.powershell.org/t/get-vhd-works-localy-but-not-remotely/25860>\
**Category:** PowerShell Help\
**Created:** [June 4, 2025, 1:51pm UTC](https://forums.powershell.org/t/get-vhd-works-localy-but-not-remotely/25860 "2025-06-04T13:51:24Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [June 5, 2025, 10:32am UTC](https://forums.powershell.org/t/get-vhd-works-localy-but-not-remotely/25860/10 "2025-06-05T10:32:31Z")

</div>

There are literally thousands of examples out there … even here in this very forum. Spend a little effort to do your own research, please.

> **[Everything you wanted to know about PSCustomObject - PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-pscustomobject?view=powershell-7.5)**
>
> PSCustomObject is a simple way to create structured data.

> **[about\_PSCustomObject - PowerShell](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_pscustomobject?view=powershell-7.5)**
>
> Explains the differences between the \[psobject\] and \[pscustomobject\] type accelerators.

> [@Trying to combine 3 variables for elegant looking output](https://forums.powershell.org/t/trying-to-combine-3-variables-for-elegant-looking-output/21351/2):
>
> Usually we use loops or nested loops in combination with a PSCustomObject to combine the results from different but related queries. Here’s an example of how to combine the results of 3 different sources in one output object: $ComputerName = 'DesiredRemoteComputer' $so = New-CimSessionOption -Protocol DCOM $CimSession = New-CimSession -CN $ComputerName -SessionOption $so $BIOS = Get-CimInstance -Class CIM\_BIOSElement -CimSession $CimSession | Select-Object -Property \* $OS = Get-CimInstance -…

> [@Trying to combine 3 variables for elegant looking output](https://forums.powershell.org/t/trying-to-combine-3-variables-for-elegant-looking-output/21351/4):
>
> … that looks weird … how do you populate $esx? Using the same variable for the loop itself and defining it inside the loop cannot work. thinking What is it actually what you want to achieve? If you want to get information about each individual VMHost of a given cluster you may run something like this: Get-Cluster -Name "swbdvcpyld01v.nslijhs.net" | Get-VMHost | ForEach-Object { $VMHostNetworkAdapter = Get-VMHostNetworkAdapter -VMKernel -VMHost $\_ $VMHostNetworkStack = Get-VMHostN…

> [@Combing 2 scripts](https://forums.powershell.org/t/combing-2-scripts/20169/2):
>
> Chad, Welcome to the forum. wave:t4 The most common way of combining the results of more than one query is to use a [PSCustomObject]. $InputComputerList = Get-Content -Path 'C:\Data\GetDescription\ComputerList.txt' $Result = foreach ($ComputerName in $InputComputerList) { $ADComputer = Get-ADComputer -Identity $ComputerName -Properties Description [PSCustomObject]@{ Name = $ADComputer.Name Description = $ADComputer.Description Online = Test-Connec…

---

_[View the full topic](https://forums.powershell.org/t/get-vhd-works-localy-but-not-remotely/25860)._
