This is how my Input looks like:
$AllDrives = '[
{
"DriveLetter": "F",
"FileSystemLabel": "Drive_F",
"AllocationUnitSize": 4096
},
{
"DriveLetter": "E",
"FileSystemLabel": "Drive_E",
"AllocationUnitSize": 4096
},
{
"DriveLetter": "H",
"FileSystemLabel": "",
"AllocationUnitSize": 65536
},
{
"DriveLetter": "I",
"FileSystemLabel": "",
"AllocationUnitSize": 65536
},
{
"DriveLetter": "G",
"FileSystemLabel": "",
"AllocationUnitSize": 65536
}
]' | ConvertFrom-Json
I want to compare another array with $AllDrives and return those elements from another array where DriveLetter is not matching with them.
$StandardDrives = @("E","F","G","H","I","J","K")
How do I accomplish this in (PowerShell way) without running two loops ?
Expected output is @("J","K")