I am using PowerShell for synching my pc with a NAS (Robocopy), I want a popup message using Windows.Forms.MessageBox to inform the user when the destination has files that the source doesn’t therefore they will be deleted from the destination (using /MIR). I want to place a link to the results of the Compare-Object file in my Message Box so the user can choose to open the file and see what will be erased before aknoleging to continue.
How can I place a link to a document on my message box?
$d = [Windows.Forms.MessageBox]::Show("Be careful! Source smaler than Destination, if you continue, data at destination will be erased. Do you wish to continue?", "Warning source smaller than destination", [Windows.Forms.MessageBoxButtons]::YesNo, [Windows.Forms.MessageBoxIcon]::Warning)
I think that the best solution for you is to abandon the MessageBox and build your own DialogBox.
You can use Sapiens PrimalForms Community Edition (It’s free, you just have to sign to Sapiens and go to download).This Framwork allow you to graphicaly build your DialogBox and then it generates the PowerShell Code for Windows Forms.