If the diesel PCM is in the same location as the gasser, it should be under the hood behind the battery bolted to the inside fender. Not hard to get to and easy to take out. You'll most likely need to get the part number off it and match it up with the replacement unit. And, yes, the PCM would need to be programmed.
A lot of places that sell PCMs will also do the programming for you, some even on eBay/Amazon. A few people have recommended "Flagship One," and I can report they had good communication when I reached out to them recently, but their prices are quite high. Wherever you get it from, I wouldn't pay much attention to any lifetime warranty claims, as they're probably not worth the digital paper they're printed on.
From doing a quick search on eBay, it looks the the PCMs for the diesel Libs are substantially higher in price than the gasoline variants, perhaps due to their rarity. If you can find someone local to program it for you cheap, it might be more economical to buy an un-programmed unit on a place like eBay.
You also may want to consider getting a second opinion from another mechanic before you go ahead and buy one, considering the significant cost you might be in for. Far too many techs are too quick to blame PCMs without doing the proper diagnosis procedures beforehand.