Last active
September 18, 2023 14:03
-
-
Save dfinke/37346fcfc4a452214190bf3e87834eb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$list1 = ConvertFrom-Csv @" | |
list1 | |
Gigi | |
Jo | |
Chin | |
Phil | |
Jojo | |
"@ | |
$list2 = ConvertFrom-Csv @" | |
list2 | |
Chin | |
Gigi | |
Jo | |
Mindy | |
Phil | |
Sioux | |
Tyrone | |
"@ | |
$xlfile = "$PSScriptRoot\lists.xlsx" | |
Remove-Item $xlfile -ErrorAction SilentlyContinue | |
$wsName = "Unique Values" | |
$c1 = New-ConditionalText -ConditionalType UniqueValues -Range '$A$2:$C$8' | |
$list1 | Export-Excel $xlfile -WorksheetName $wsName | |
$list2 | Export-Excel $xlfile -WorksheetName $wsName -StartColumn 3 -ConditionalText $c1 -Show |
Author
dfinke
commented
Sep 18, 2023
I believe I have a good use case for this awesomeness.
Yes - This is a fine use case.
Comparing users group memberships.
$Mark = Get-ADPrincipalGroupMembership Mark | Sort Name | Select @{N='Mark';E={$PSItem.Name}}
$Wes = Get-ADPrincipalGroupMembership Wes | Sort Name | Select @{N='Wes';E={$PSItem.Name}}
$xlfile = "c:\temp\groups.xlsx"
Remove-Item $xlfile -ErrorAction SilentlyContinue
$wsName = "Unique Values"
$c1 = New-ConditionalText -ConditionalType UniqueValues -Range '$A:$C'
$Mark | Export-Excel $xlfile -WorksheetName $wsName
$Wes | Export-Excel $xlfile -WorksheetName $wsName -StartColumn 3 -ConditionalText $c1 -Show
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment