mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-16 08:13:54 +00:00
Move help from Comment-based to md. Relocate functions (sans help)
This commit is contained in:
23
ExportedCommands/Update-FirstObjectProperties.ps1
Normal file
23
ExportedCommands/Update-FirstObjectProperties.ps1
Normal file
@@ -0,0 +1,23 @@
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Scope='Function', Target='Update*', Justification='Does not change system state')]
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', '', Scope='Function', Target='Update*', Justification='Property would be incorrect')]
|
||||
|
||||
param()
|
||||
|
||||
Function Update-FirstObjectProperties {
|
||||
|
||||
Try {
|
||||
$Union = @()
|
||||
$Input | ForEach-Object {
|
||||
If ($Union.Count) {
|
||||
$_ | Get-Member | Where-Object {-not ($Union[0] | Get-Member $_.Name)} | ForEach-Object {
|
||||
$Union[0] | Add-Member -MemberType NoteProperty -Name $_.Name -Value $Null
|
||||
}
|
||||
}
|
||||
$Union += $_
|
||||
}
|
||||
$Union
|
||||
}
|
||||
Catch {
|
||||
throw "Failed updating the properties of the first object: $_"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user