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])



6 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. I really appreciate for this great information, This type of message always inspiring and I prefer to read quality content. so happy to find good place to many here in the post. the writing is just great. thanks for the post.shopify best currency converter , sale discount app on Shopify , Create Discount master , best apps to boost sales on shopify

    ReplyDelete
  3. Since Saturday I decided to take my training for the next few weeks into my own hands as the current training and nutrition style was a little too much. I have 15 weeks to go, so not feeling the need to be so drained so far out.
    kizi Games online
    friv jogos gratis
    play friv Games

    ReplyDelete
  4. 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
  5. วันนี้จะมาแนะนำ ทดลองเล่นสล็อต megagame กับเว็บไซต์เราได้เเล้ววันนี้ที่ MEGA GAME ทุกท่านจะพบ กับเกมสล็อตออนไลน์ รูปแบบใหม่มีมากกว่า 1000 เกมที่เราได้คัดสรรมาให้นักเสี่ยงโชค

    ReplyDelete
  6. เพื่อให้ทางเพื่อน สมาชิก ของเว็บไซต์ vk betflix สล็อตออนไลน์ โบนัสไม่อั้น เว็บพนัน ออนไลน์ ที่ให้บริการ เกมสล็อต pg slot โดยตรง ได้เข้ามา เลือกเล่น betflix

    ReplyDelete