I am trying to iterate over an array that's similar to the below structure, and for each object that has the same id, I want them combined into a single object but with an array of all the 'names' associated with that id. My Array is pre-sorted by…
I'm writing a script to compare 2 samba locations via compare object.
To speed things up i would like to give each location via a thread to a scriptblock where i let the object get made.
After that i'd like the output from the scriptblock as an…
Good day. What I am trying to accomplish is showing the DisplayName as well as the Name but the only thing I can get to show with Compare-Object is Name so I am trying to pass the output from Compare-Object into Get-ADUser to get more user…
I have two PS scripts, one reads from a list of computers on Sharepoint and outputs the results and the other outputs a list of computers from Active Directory.
What I need to do is somehow compare both of these lists to see:
a) If list A has…
I'm comparing two lengthy text files together by running the script below and writing results into text file. Instead of expected standard compare-object output I get a part of it and everything else gets trimmed (due to maximum characters limit or…
I'm able to diff contents ("cells") of two CSVs and get output of the highest value using the following function:
Compare-Object $oldfile $latestfile -Property "UsedSize" -PassThru | select-Object "VolumeName", "UsedSize" | export-csv…
I have code
Compare-Object $str $str1 | foreach InputObject | ft -auto | out-file "$resault" -width 5000
and I get somthing that looks like this
\\Server\path\path\Config.Current.Running.rt-1.ci.cou.txt
and i want only some part of it =…
Why does Compare-Object work as expected where -EQ fails to accurately compare arrays of strings?
I had a PowerShell script which was populating an array of strings and was using the -EQ operator to test against the expected values - this was always…
I try to compare two Arrays of user accounts and I'd like to find the unique accounts.
Array number one contains following data:
PS C:\Users\admin...\Desktop> $ExcludedUsers
Name …
i run
$serv1=gwmi -Namespace Root\cimv2 -Class Win32_service
i stop some services manually and then run
$serv2=gwmi -Namespace Root\cimv2 -Class Win32_service
and then i compare these 2 objects
compare-object $serv1 $serv2
compare-object…
I am trying to export my results from a compare-object into a csv but I get an error When I export it. It looks ok when I just call it in excel. My guess is whenever there is a output of more than one value the error is placed instead of the…
I want to send some object to function for check it and set him some data.
For example:
i have 4 properties (with int type) of self class (inherit from NSObject class). And i want to change their data in one function. I must send dress of this…
I have two arrays and I'm trying to compare them using compare-object.
Aim here is to get the items that aren't in common. I collected the data in to two arrays $result1 and $result2
$result1
customersourceid
---------------- …
I'm really new to PS and have been cracking my head on a particular problem. I'm trying to get the differences between what is in AD and what SCOM is monitoring already. Based on that I'll run a discovery or push out a look for certain services and…