Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PaperCut.ps1 #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 6 additions & 16 deletions PaperCut.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function Idm-UsersRead {
$i = 0
foreach($user in $userList) {
$i++
Log info "Processing user $($i) of $($userList.count)"
#Log info "Processing user $($i) of $($userList.count)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should avoid leaving commented out code in the connector. If we aren't using it, we should remove it.


$userObject = Get-UserProperties -system_params $system_params -function_params $function_params -username $user

Expand Down Expand Up @@ -494,24 +494,14 @@ function Idm-UsersUpdate {
</value>
</param>
</params>
</methodCall>' -f $system_params.authtoken, $properties.Username, $propertiesXML
</methodCall>' -f $system_params.authtoken, $function_params.Username, $propertiesXML

LogIO info 'Idm-UsersUpdate' -In -Parameters $function_params
LogIO info 'Idm-UsersUpdate' -In -Parameters $function_params # $xmlRequest

$response = Invoke-PaperCutRequest -system_params $system_params -function_params $function_params -Body $xmlRequest

LogIO info 'Idm-UsersUpdate' -Out ($response)

# Output is a boolean.
if ($response = 1) {

LogIO info 'Idm-UsersUpdate' -Out -Response $response

} else {

#Log error ("Failed to Update Properties for ({0}), response: ({1})" -f $properties.Username, ($response | ConvertTo-Json -Depth 5))
LogIO error 'Idm-UsersUpdate' -Out -Response $response
throw ("Failed to Update Properties for ({0}), response: ({1})" -f $properties.Username, ($response | ConvertTo-Json -Depth 5))

}
# Out new object
Get-UserProperties -system_params $system_params -function_params $function_params -username $function_params.Username
}
Expand Down Expand Up @@ -772,4 +762,4 @@ function Invoke-PaperCutRequest {
finally {
Write-Output $result
}
}
}