Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Generate Granfeldt PowerShell Management Agent Schema File - CSV File. Supporting blog post can be located here
# CSV Exported from IdentityNow Source
$csv = Get-Content -Path "C:\path\to\file\file.csv"
# Get header row and split on ,
$columns = $csv[0].Split(",")
# Generate Output Schema.ps1
$output = @()
$output += "`$obj = New-Object -Type PSCustomObject"
$output += "`$obj | Add-Member -Type NoteProperty -Name `"Anchor-YourAnchorATTR|String`" -Value `"`""
$output += "`$obj | Add-Member -Type NoteProperty -Name `"objectClass|String`" -Value `"YourObjectClass`""
foreach ($obj in $columns) {
$output += "`$obj | Add-Member -Type NoteProperty -Name `"$($obj)|string`" -Value `"string" + "`""
$output += "`$obj"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.