Convert from Powershell to vb.net

Good Afternoon,

i’m sorry to ask, but i’m really noob with powershell and i’m struggling with this bunch of code, this will be a part of a link that is generated(see below).

it convert our guid document saved for example "“9999999999199012537”

in an OID that will be a part of the string that composed this website, in this way it works, but i need to convert it to vb, and you will say why? because i want to integrate on my consol application for an internal use. Do you have any Idea?

$link= “http://test.$branch.net:7408/edoc/main?object=document&method=stream&watermark=true&OID=”+ (ConvertTo-Oid -guid $eDocTable[$eDocIndex].G_U_I_D)

Param([Parameter(Position=0, Mandatory=$true)]  [String] $guid)

$guidClass = (($guid -shr 60) -band 15)

$guidID    = (($guid -band 0x0FFFFFFFFFFFFFFFL) -shr (60 - ($guidClass * 4)))

$guidValue = $guid -band (0x0FFFFFFFFFFFFFFFL -shr ($guidClass * 4))

#Assemble result

if (($guidClass -eq 0) -and ($guidID -eq 0)) {

# Handle special case

return "0-" + '{0:X}' -f $guidValue

}

else{

return ("" + ('{0:X}' -f $guidClass) + "" + ('{0:X}' -f $guidID) + "-" + ('{0:X}' -f $guidValue))

}

}

Thank you,

have a great day!

Yes, why ? Can you give more details on why VB is required here, somebody might be able to help you in that.