Moving variable sets between Octopus servers with Powershell

I am trying to move a Library Variable Set between two Octopus Servers. I can get the variable set from the first sever and post it to the second server but the posted variable set has no variables in it. Attached is an excerpt from my current Powershell script.

VariableSetExample.ps1 (472 Bytes)