I want to search particular keyword from one file to another file, if the keyword in one file doesn't there then it should display that keyword. Both the Json files having different syntax. I want to achieve this through Powershell:
File 1: Data.json
[
"The request will be processed at a domain controller for domain xxx.COM.",
"",
"Group name ROL_xxx_xxx.NetAppProdAdmins",
"Comment Owner: Ramesh (XXXX\\ramesh)",
"",
"Members",
"",
"-------------------------------------------------------------------------------",
"RAJESH1 RAMESH1 ASHOK12 ",
"ABHIJIT RITIKA1 BHUPESH ",
"YASHWAN ",
"The command completed successfully.",
""
]
Second File: Data2.json
{
"Group": {
"Path": "/xx-life-xxxxx-xxxx/",
"CreateDate": "2017-12-08T12:08:39Z",
"GroupId": "xxxxxxxxxxxxxxxxxxxxx",
"Arn": "arn:aws:iam::123456789012:group/xx-xxxx-xxxxxxx-xxxxxx/xx-xxxx-xxxxxxx-xxxxxx-admin",
"GroupName": "xx-xxxx-xxxxxxx-xxxxxx-admin"
},
"Users": [
{
"UserName": "RAJESH1",
"PasswordLastUsed": "2020-05-06T07:10:37Z",
"CreateDate": "2020-03-27T07:12:44Z",
"UserId": "ASDFGHJKLQWERTYUIOZX",
"Path": "/xx-xxxx-xxxxxxx-xxxxxx/",
"Arn": "arn:aws:iam::123456789012:user/xx-xxxx-xxxxxxx-xxxxxx/RAJESH1"
},
{
"UserName": "RAMESH1",
"PasswordLastUsed": "2020-06-04T07:01:44Z",
"CreateDate": "2019-07-25T08:36:28Z",
"UserId": "ASDFGHJKLQWERTYUIOZX",
"Path": "/xx-xxxx-xxxxxxx-xxxxxx/",
"Arn": "arn:aws:iam::123456789012:user/xx-xxxx-xxxxxxx-xxxxxx/RAMESH1"
},
{
"UserName": "ASHOK12",
"PasswordLastUsed": "2020-06-03T13:18:49Z",
"CreateDate": "2020-04-20T14:43:59Z",
"UserId": "ASDFGHJKLQWERTYUIOZX",
"Path": "/xx-xxxx-xxxxxxx-xxxxxx/",
"Arn": "arn:aws:iam::123456789012:user/xx-xxxx-xxxxxxx-xxxxxx/ASHOK12"
},
{
"UserName": "ABHIJIT",
"PasswordLastUsed": "2020-06-05T03:20:48Z",
"CreateDate": "2019-05-15T09:55:04Z",
"UserId": "AIDA5GALAASEO7TUXCB3T",
"Path": "/xx-xxxx-xxxxxxx-xxxxxx/",
"Arn": "arn:aws:iam::123456789012:user/xx-xxxx-xxxxxxx-xxxxxx/ABHIJIT"
},
{
"UserName": "RITIKA1",
"PasswordLastUsed": "2020-06-02T14:01:11Z",
"CreateDate": "2019-08-01T11:13:30Z",
"UserId": "AIDA5GALAASEOADBBKJ7N",
"Path": "/xx-xxxx-xxxxxxx-xxxxxx/",
"Arn": "arn:aws:iam::123456789012:user/xx-xxxx-xxxxxxx-xxxxxx/RITIKA1"
},
{
"UserName": "BHUPESH",
"PasswordLastUsed": "2020-06-01T08:13:14Z",
"CreateDate": "2018-07-26T14:11:10Z",
"UserId": "AIDAI2A5HABPPLA6PL5AC",
"Path": "/xx-xxxx-xxxxxxx-xxxxxx/",
"Arn": "arn:aws:iam::123456789012:user/xx-xxxx-xxxxxxx-xxxxxx/BHUPESH"
}
]
}
So particularly I want to search RAJESH1 from first json to the second Json, if it is there then it's fine if it's not there then it will show RAJESH1 in the output. In above two JSON "YASHWAN" is not present in second JSON so the output needs to come as "YASHWAN".
Thanks in Advance.