OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Removing rows from an array sourced from item in another array

  • Thread starter Thread starter Xrai
  • Start date Start date
X

Xrai

Guest
I'm using $Devices = Get-MgDevice to get the devices from Azure with Graph $autopilot = Get-MgDeviceManagementWindowsAutopilotDeviceIdentity to get all the autopilot devices

I wish to remove the $autopilot devices from $Devices and I have an $autopilot.AzureActiveDirectoryDeviceId which I can match to an Id/DeviceId (one of those anyway) in the $Devices.

I could loop through $Devices and compare to each $autopilot for the value but I was wondering if there was something a bit more efficient to do the same.

I've seen some $listA = $listA |Where-Object { $listB -notcontains $_.somevalue } stuff but can't seem to find any examples where it's a bit more complex referencing object values. So I'm not sure if I'm struggling with syntax or functionality
<p>I'm using
$Devices = Get-MgDevice to get the devices from Azure with Graph
$autopilot = Get-MgDeviceManagementWindowsAutopilotDeviceIdentity to get all the autopilot devices</p>
<p>I wish to remove the $autopilot devices from $Devices and I have an $autopilot.AzureActiveDirectoryDeviceId which I can match to an Id/DeviceId (one of those anyway) in the $Devices.</p>
<p>I could loop through $Devices and compare to each $autopilot for the value but I was wondering if there was something a bit more efficient to do the same.</p>
<p>I've seen some $listA = $listA |Where-Object { $listB -notcontains $_.somevalue } stuff but can't seem to find any examples where it's a bit more complex referencing object values. So I'm not sure if I'm struggling with syntax or functionality</p>
Continue reading...
 

Latest posts

M
Replies
0
Views
1
MusicLovingIndianGirl
M
Q
Replies
0
Views
1
quora question
Q
Top