Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 586 Bytes

File metadata and controls

41 lines (29 loc) · 586 Bytes

Rename NoteProperty of objects

SCRIPT

Rename-NoteProperty.ps1

DESCRIPTION

A function to rename one or multiple NoteProperty of objects.

A simple test

See examples in the test folder.

<# TEST #>

$IncPath = ".\functions\"
.$IncPath"Rename-NoteProperty.ps1"

# Example data
$myArray = @(
    [PSCustomObject]@{ City = "Berlin" },
    [PSCustomObject]@{ City = "Tokyo" },
    [PSCustomObject]@{ City = "Delhi" }
)

Rename-NoteProperty -objects $myArray -oldName 'City' -newName 'Town'

Output

Town
----
Berlin
Tokyo
Delhi