Monday, June 13, 2016

FIM Powershell Module: Remove/unset/clear a single-valued reference attribute

In the latest version of the FIM Powershell Module (2016-05-18), in order to remove/unset/clear a single-valued reference attribute, you're supposed to do this:

New-FimImportChange -Operation 'Replace' -AttributeName "Manager"

Note that you just don't supply the -AttributeValue paramter.  However, in my script, I don't want to perform the extra step of checking whether my value is present; so I'd like to do this:

New-FimImportChange -Operation 'Replace' -AttributeName "Manager" -AttributeValue "$newManager"

In order to do that, I had to make a small change to New-FimImportChange in FimPowerShellModule.psm1:

###
### Process the AttributeValue Parameter
###
if (!$AttributeValue)
{
    # Allow the caller to pass an empty AttributeValue to unset it, but DO NOT set the AttributeValue on the ImportChange object.
}
elseif ($AttributeValue -is [String])
{
    $importChange.AttributeValue = $AttributeValue
}
elseif ($AttributeValue -is [DateTime])



2 comments:

  1. These articles are exactly what I need. It is very nice of you to share your understanding. I have learned interesting things. I have a liking for your posts. Please, upload more and more posts.pop website pop price guide app

    ReplyDelete
  2. Casino Queen - Mapyro
    The Casino Queen is a 양산 출장샵 casino 김해 출장마사지 located in 수원 출장마사지 Las Vegas, 김해 출장샵 Nevada, United States. The casino was established in 1989 by a retired Las Vegas casino owner, Steve 인천광역 출장마사지 Wynn.

    ReplyDelete