diff --git a/LazyTS.exe b/LazyTS.exe index d9003ff..9444b4f 100644 Binary files a/LazyTS.exe and b/LazyTS.exe differ diff --git a/LazyTS.ps1 b/LazyTS.ps1 index b9be3ce..2d89b8a 100644 --- a/LazyTS.ps1 +++ b/LazyTS.ps1 @@ -1,22 +1,40 @@ #------------------------------------------------------------------------ # Source File Information (DO NOT MODIFY) # Source ID: 8c368515-c779-4ebb-95db-cf067966c8e3 -# Source File: ..\Sources\LazyTS.psproj +# Source File: ..\LazyTS.psproj #------------------------------------------------------------------------ +#region Project Recovery Data (DO NOT MODIFY) +<#RecoveryData: +NQIAAB+LCAAAAAAABACNkl1rgzAUhu8L/Q+Se6vS+VGIuZhdx2BftLLbEuNxZMREEh1zv35x2mIZ +jN7lPec9z3s4BO+BqU/Q/Za2lCwXjoNftfoA1v4KK99AG64kCbB3ek6dHRfwsCUJW0dJGIQui+ON +ewNF4W7CsnBZ5UfxJopYAmvsTeZpdMrI+waIj725nMHNJCbp7KECDZLBM60hRci57bgoU+Qjcmip +brtm1RgzZv0/mlEh3CfK5U7p+tiYas461S2suhp2L1RBhUUFM5STqbqmsrz7akEOp0tRrjtAZHQb +mxBcnZBRYzg9lkKcEwJExurKVi9AoxgPeL7vqF40f+eSisEw4Mkj/e7zg92lsTbs/ekvF9i7+CY/ +VVdZhDUCAAA=#> +#endregion <# .NOTES -------------------------------------------------------------------------------- - Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2014 v4.1.71 - Generated on: 2014-10-03 1:17 AM - Generated by: Francois-Xavier Cat - Organization: LazyWinAdmin.com + Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2015 v4.2.81 + Generated on: 2015-03-01 6:10 PM + Generated by: Francois-Xavier + Organization: LazyWinAdmin -------------------------------------------------------------------------------- .DESCRIPTION - Script generated by PowerShell Studio 2014 + Script generated by PowerShell Studio 2015 #> #region Source: Startup.pss +#region File Recovery Data (DO NOT MODIFY) +<#RecoveryData: +xQQAAB+LCAAAAAAABAC9lMlqwzAQQO+F/oPJ2Xip4jgBxxBSciltQ13aXsf22IhqCSM5wX9fZyEJ +LXQJ1Ogyo5Hm8ZCY5AkLvUZqb8GC0wWGazUd3AzS6yvHSR6J11yBWHCBDyAxzSyQbVbeypjE/1Ld +3ZkZgzIXHM0uP+20adYai9K7BwU1SlTWmzVWS7Ad1HVeDnTmBdvlOvNG2IZwqrCxBMJ1lk3Xt7jD +9lm/Y3cwzCs2jkZQstEQWZT4R9JnsjSFJsHzE2X4W0oexxAV0SicsCEG48k3lL1fHwzvlatSb4y3 +0CRNL8TtD+kHRLDhqr6EFbAqquIqDMsoAAY/s96k6MeJExZWU5shrXmBFz3Zn+3mmrAXvYPVknSn +9g9ux3Q/VRL/fGylH3nEhp/FBAAA#> +#endregion #---------------------------------------------- #region Import Assemblies #---------------------------------------------- @@ -40,18 +58,221 @@ function Main { { } $global:ExitCode = 0 #Set the exit code for the Packager -} - - - - - - -#endregion Source: Startup.pss +}#endregion Source: Startup.pss #region Source: MainForm.psf function Call-MainForm_psf { +#region File Recovery Data (DO NOT MODIFY) +<#RecoveryData: +vKwAAB+LCAAAAAAABADtvWmTo8bSP/peEfoOHY774v8P/LgEYr1xjiMQCIFWhEAg3txgX8QmNi2f +/hZST0/PTC/q8YyP7efgaKyEWrIyf5WVWSTMvxTPyVuvPPNWbT3AH1WUZ//+Bfvl937v4eFfqzIK +osxKhCjxllbq/b6wokzIy/S3ovL/Bb65fatkx55TP9Tnwvv3L5tzVXvpb3qUufmx+q2rezv/+vDS +rV8fto884L8Nuv9+feCapG5K79+Z19Sllfz6IDd2Ejkz76zmey/7t01RFuEQJMoMcW9AM788ZJCV +f//yidVfHpwwStwSFv2Fy7O6zJPqNjzIq1zmhVfW58c6XBJ5Wb2JLt4vv1PY8NeHIT74F/hU6JVK +kpNnnxqEd0dQIuX5d5ZlRyy7ZiejAP4csxLLSdyaZZWO5Njgep9j2QMsxS7wKTyvx2x3hvcmAfw5 +wiawlBDu2H7v1gK7hhXYYYjDFroG2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+8L/YRP1n5t/rmS33T8NX2/gTZuPD/7n1/tD9u07/9+Nz81Xe/yGa/eN6/a9W/3paffVZzEeV+1pD +f6aOH3n4bjW/NoZ/uK4/4ii909L/Bm2zVeWlUAde9am/xyvnx4dqvy2szAq8FFb/rftH7NLr6yaf +dTu8V7dD1PaHNEFa7pDEvSHxL/DU09c9p5WTl0lk/wAEvdHLbXx/Rh8/fF6832P37zr+OR2V1hG6 +gN/T12DoEz7lo6hLDKyh9X5fRpr8OWOKSjhB8vK88co2crzvUtmHR8flpfenDO9xVI9Pr/6UsUFb +FQXZj+/qibwZsH8BxXPy1ivPHf5///8B8ErY7rysAAA=#> +#endregion #---------------------------------------------- #region Import the Assemblies #---------------------------------------------- @@ -74,11 +295,14 @@ function Call-MainForm_psf $MainForm = New-Object 'System.Windows.Forms.Form' $datagridviewOutput = New-Object 'System.Windows.Forms.DataGridView' $groupbox1 = New-Object 'System.Windows.Forms.GroupBox' + $buttonReset = New-Object 'System.Windows.Forms.Button' + $buttonFilter = New-Object 'System.Windows.Forms.Button' + $textboxHighlight = New-Object 'System.Windows.Forms.TextBox' + $buttonHighlight = New-Object 'System.Windows.Forms.Button' $buttonMessage = New-Object 'System.Windows.Forms.Button' $textboxComputerName = New-Object 'System.Windows.Forms.TextBox' $labelComputerName = New-Object 'System.Windows.Forms.Label' $buttonGetTsSession = New-Object 'System.Windows.Forms.Button' - $buttonExit = New-Object 'System.Windows.Forms.Button' $buttonProcess = New-Object 'System.Windows.Forms.Button' $richtextboxStatus = New-Object 'System.Windows.Forms.RichTextBox' $statusstrip1 = New-Object 'System.Windows.Forms.StatusStrip' @@ -93,6 +317,16 @@ function Call-MainForm_psf $stopTSSessionToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem' $toolstripstatuslabel1 = New-Object 'System.Windows.Forms.ToolStripStatusLabel' $toolstripstatuslabel2 = New-Object 'System.Windows.Forms.ToolStripStatusLabel' + $toolstripseparator1 = New-Object 'System.Windows.Forms.ToolStripSeparator' + $remoteDesktopToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem' + $powerShellRemotingToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem' + $toolstripseparator2 = New-Object 'System.Windows.Forms.ToolStripSeparator' + $remoteDesktopToolStripMenuItem1 = New-Object 'System.Windows.Forms.ToolStripMenuItem' + $powerShellRemotingToolStripMenuItem1 = New-Object 'System.Windows.Forms.ToolStripMenuItem' + $remoteDesktopShadowIDToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem' + $remoteDesktopShadowToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem' + $remoteDesktopShadowControlToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem' + $remoteDesktopShadowControlToolStripMenuItem1 = New-Object 'System.Windows.Forms.ToolStripMenuItem' $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' #endregion Generated Form Objects @@ -135,9 +369,10 @@ function Call-MainForm_psf LastInputTime = $_.LastInputTime LoginTime = $_.LoginTime }#pscustomobject properties - } #FOREACH - #Load-DataGridView -DataGridView $datagridviewOutput -Item (ConvertTo-DataTable -InputObject $output) - Load-DataGridView -DataGridView $datagridviewOutput -Item $output + } #FOREACH + + $global:outputDT = ConvertTo-DataTable -InputObject $output + Load-DataGridView -DataGridView $datagridviewOutput -Item $outputDT Append-RichtextboxStatus -ComputerName $textboxComputerName.Text -Source "Get-TSSession" -Message "Loaded" } CATCH{ @@ -167,8 +402,9 @@ function Call-MainForm_psf UnderlyingProcess = $_.UnderlyingProcess }#pscustomobject properties }#FOREACH-OBJECT - - Load-DataGridView -DataGridView $datagridviewOutput -Item (ConvertTo-DataTable -InputObject $output) + + $global:outputDT = ConvertTo-DataTable -InputObject $output + Load-DataGridView -DataGridView $datagridviewOutput -Item $outputDT Append-RichtextboxStatus -ComputerName $textboxComputerName.Text -Source "Get-TSProcess" -Message "Loaded" }#TRY CATCH{ @@ -235,7 +471,7 @@ function Call-MainForm_psf }#TRY CATCH{ Write-Warning -Message "$textboxComputerName.Text - Send-TSMessage Error" - Write-Warning -Message "$Error[0].Exception" + Write-Warning -Message "$($Error[0].Exception)" Append-RichtextboxStatus -ComputerName $textboxComputerName.Text -Source "Send-TSMessage" -Message "Sending Error" -MessageColor 'Red' Append-RichtextboxStatus -ComputerName $textboxComputerName.Text -Source "Send-TSMessage" -Message "Last Error ($error[0])" -MessageColor 'Red' } @@ -415,7 +651,91 @@ function Call-MainForm_psf Append-RichtextboxStatus -ComputerName $textboxComputerName.Text -Source "Stop-TSSession" -Message "Last Error ($error[0])" -MessageColor 'Red' }#CATCH } - # --End User Generated Script-- + + $remoteDesktopToolStripMenuItem_Click={ + Start-Process -FilePath 'mstsc' -ArgumentList "/v:$($textboxComputerName.Text):3389 /admin" + } + + $powerShellRemotingToolStripMenuItem_Click={ + Start-Process powershell.exe -ArgumentList "-noexit -command Enter-PSSession -ComputerName $($textboxComputerName.Text)" + } + + $buttonHighlight_Click = { + Clear-DataGridViewSelection -DataGridView $datagridviewOutput + Reset-DataGridViewFormat -DataGridView $datagridviewOutput + Set-DataGridView -DataGridView $datagridviewOutput -AlternativeRowColor -BackColor 'AliceBlue' -ForeColor 'Black' + Find-DataGridViewValue -DataGridView $datagridviewOutput -RowForeColor 'red' -RowBackColor 'Black' -Value $textboxHighlight.Text + } + + $buttonReset_Click={ + + } + + $buttonFilter_Click={ + Set-DataGridViewFilter -DataGridView $datagridviewOutput -AllColumns -DataTable $outputDT -Filter $textboxHighlight.Text + } + + $remoteDesktopShadowIDToolStripMenuItem_Click = { + TRY + { + # ONE ROW SELECTED + IF ($datagridviewOutput.SelectedRows.Count -eq 1) + { + IF ([System.Windows.Forms.MessageBox]::Show("Do you want to connect the SessionID $($datagridviewOutput.currentrow.Cells[1].value) on $($textboxComputerName.text)?", "Question", [System.Windows.Forms.MessageBoxButtons]::YesNo) -eq 'Yes') + { + $SessionID = $($datagridviewOutput.currentrow.Cells[1].value) + Append-RichtextboxStatus -ComputerName $textboxComputerName.Text -Source "Remote Desktop" -Message "Opening Shadow (view) session $SessionID on $($textboxComputerName.text)" + Start-Process -FilePath 'mstsc' -ArgumentList "/v:$($textboxComputerName.Text):3389 /shadow:$SessionID" + }# Message Box + }#IF + IF ($datagridviewOutput.SelectedRows.Count -gt 1) + { + Append-RichtextboxStatus -ComputerName $textboxComputerName.Text -Source "Remote Desktop" -Message "Please select only one row" -MessageColor 'red' + } + } + CATCH + { + Write-Warning -Message "$textboxComputerName.Text - Remote Desktop (Shadow/View) Error" + Write-Warning -Message "$Error[0].Exception" + Append-RichtextboxStatus -ComputerName $textboxComputerName.Text -Source "Remote Desktop" -Message "Error while opening session" -MessageColor 'red' + } + } + $remoteDesktopShadowControlToolStripMenuItem_Click={ + TRY + { + # ONE ROW SELECTED + IF ($datagridviewOutput.SelectedRows.Count -eq 1) + { + IF ([System.Windows.Forms.MessageBox]::Show("Do you want to connect the SessionID $($datagridviewOutput.currentrow.Cells[1].value) on $($textboxComputerName.text)?", "Question", [System.Windows.Forms.MessageBoxButtons]::YesNo) -eq 'Yes') + { + $SessionID = $($datagridviewOutput.currentrow.Cells[1].value) + Append-RichtextboxStatus -ComputerName $textboxComputerName.Text -Source "Remote Desktop" -Message "Opening Shadow (control) session $SessionID on $($textboxComputerName.text)" + Start-Process -FilePath 'mstsc' -ArgumentList "/v:$($textboxComputerName.Text):3389 /shadow:$SessionID /control" + }# Message Box + }#IF + IF ($datagridviewOutput.SelectedRows.Count -gt 1) + { + Append-RichtextboxStatus -ComputerName $textboxComputerName.Text -Source "Remote Desktop" -Message "Please select only one row" -MessageColor 'red' + } + IF ($datagridviewOutput.SelectedRows.Count -eq 0) + { + New-MessageBox -Buttons 'OK' -Icon 'Information' -Message "Please select a row" -Title "No session specified" + } + } + CATCH + { + Write-Warning -Message "$textboxComputerName.Text - Remote Desktop (Shadow/Control) Error" + Write-Warning -Message "$Error[0].Exception" + Append-RichtextboxStatus -ComputerName $textboxComputerName.Text -Source "Remote Desktop" -Message "Error while opening session" -MessageColor 'red' + } + } + + + foreach ($i in $datagridviewOutput.Columns) + { + $i.GetType + + } # --End User Generated Script-- #---------------------------------------------- #region Generated Events #---------------------------------------------- @@ -429,6 +749,7 @@ function Call-MainForm_psf $Form_StoreValues_Closing= { #Store the control values + $script:MainForm_textboxHighlight = $textboxHighlight.Text $script:MainForm_textboxComputerName = $textboxComputerName.Text $script:MainForm_richtextboxStatus = $richtextboxStatus.Text } @@ -439,10 +760,11 @@ function Call-MainForm_psf #Remove all event handlers from the controls try { - $datagridviewOutput.remove_ColumnHeaderMouseClick($datagridviewOutput_ColumnHeaderMouseClick) + $buttonReset.remove_Click($buttonReset_Click) + $buttonFilter.remove_Click($buttonFilter_Click) + $buttonHighlight.remove_Click($buttonHighlight_Click) $buttonMessage.remove_Click($buttonMessage_Click) $buttonGetTsSession.remove_Click($buttonGetTsSession_Click) - $buttonExit.remove_Click($buttonExit_Click) $buttonProcess.remove_Click($buttonProcess_Click) $MainForm.remove_Load($OnLoadFormEvent) $disconnectTSSessionToolStripMenuItem.remove_Click($disconnectTSSessionToolStripMenuItem_Click) @@ -451,6 +773,14 @@ function Call-MainForm_psf $stopTSProcessToolStripMenuItem.remove_Click($stopTSProcessToolStripMenuItem_Click) $stopTSSessionToolStripMenuItem.remove_Click($stopTSSessionToolStripMenuItem_Click) $toolstripstatuslabel1.remove_Click($toolstripstatuslabel1_Click) + $remoteDesktopToolStripMenuItem.remove_Click($remoteDesktopToolStripMenuItem_Click) + $powerShellRemotingToolStripMenuItem.remove_Click($powerShellRemotingToolStripMenuItem_Click) + $remoteDesktopToolStripMenuItem1.remove_Click($remoteDesktopToolStripMenuItem_Click) + $powerShellRemotingToolStripMenuItem1.remove_Click($powerShellRemotingToolStripMenuItem_Click) + $remoteDesktopShadowIDToolStripMenuItem.remove_Click($remoteDesktopShadowIDToolStripMenuItem_Click) + $remoteDesktopShadowToolStripMenuItem.remove_Click($remoteDesktopShadowIDToolStripMenuItem_Click) + $remoteDesktopShadowControlToolStripMenuItem.remove_Click($remoteDesktopShadowControlToolStripMenuItem_Click) + $remoteDesktopShadowControlToolStripMenuItem1.remove_Click($remoteDesktopShadowControlToolStripMenuItem_Click) $MainForm.remove_Load($Form_StateCorrection_Load) $MainForm.remove_Closing($Form_StoreValues_Closing) $MainForm.remove_FormClosed($Form_Cleanup_FormClosed) @@ -465,6 +795,9 @@ function Call-MainForm_psf #---------------------------------------------- $MainForm.SuspendLayout() $groupbox1.SuspendLayout() + $statusstrip1.SuspendLayout() + $contextmenustripTSSession.SuspendLayout() + $contextmenustripTSProcess.SuspendLayout() # # MainForm # @@ -472,7 +805,7 @@ function Call-MainForm_psf $MainForm.Controls.Add($groupbox1) $MainForm.Controls.Add($richtextboxStatus) $MainForm.Controls.Add($statusstrip1) - $MainForm.ClientSize = '634, 324' + $MainForm.ClientSize = '723, 340' #region Binary Data $MainForm.Icon = [System.Convert]::FromBase64String(' AAABAAQAGBgAAAEAIACICQAARgAAACAgAAABACAAqBAAAM4JAAAQEAAAAQAgAGgEAAB2GgAAFhYA @@ -651,7 +984,7 @@ gP+DgID/g4CA/4OAgP+DgID/g4CA/4OAgP+DgID/g4CA/4OAgP+DgID/g4CA/4OAgP+DgID/g4CA /4OAgP+DgID/g4CA/4OAgMH/g/wAAAAAAAAAAAAAAAAA/wH8AP/H/AAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA') #endregion - $MainForm.MinimumSize = '650, 363' + $MainForm.MinimumSize = '700, 379' $MainForm.Name = "MainForm" $MainForm.StartPosition = 'CenterScreen' $MainForm.Text = "LazyTS" @@ -662,6 +995,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA') $datagridviewOutput.AllowUserToAddRows = $False $datagridviewOutput.AllowUserToDeleteRows = $False $datagridviewOutput.AllowUserToOrderColumns = $True + $datagridviewOutput.AutoSizeColumnsMode = 'DisplayedCells' $datagridviewOutput.ContextMenuStrip = $contextmenustripTSSession $datagridviewOutput.Dock = 'Fill' $datagridviewOutput.Location = '0, 73' @@ -669,25 +1003,70 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA') $datagridviewOutput.ReadOnly = $True $datagridviewOutput.RowHeadersVisible = $False $datagridviewOutput.SelectionMode = 'FullRowSelect' - $datagridviewOutput.Size = '634, 158' + $datagridviewOutput.Size = '723, 174' $datagridviewOutput.TabIndex = 5 - $datagridviewOutput.add_ColumnHeaderMouseClick($datagridviewOutput_ColumnHeaderMouseClick) # # groupbox1 # + $groupbox1.Controls.Add($buttonReset) + $groupbox1.Controls.Add($buttonFilter) + $groupbox1.Controls.Add($textboxHighlight) + $groupbox1.Controls.Add($buttonHighlight) $groupbox1.Controls.Add($buttonMessage) $groupbox1.Controls.Add($textboxComputerName) $groupbox1.Controls.Add($labelComputerName) $groupbox1.Controls.Add($buttonGetTsSession) - $groupbox1.Controls.Add($buttonExit) $groupbox1.Controls.Add($buttonProcess) $groupbox1.Dock = 'Top' $groupbox1.Location = '0, 0' $groupbox1.Name = "groupbox1" - $groupbox1.Size = '634, 73' + $groupbox1.Size = '723, 73' $groupbox1.TabIndex = 9 $groupbox1.TabStop = $False # + # buttonReset + # + $buttonReset.Anchor = 'Top, Right' + $buttonReset.Enabled = $False + $buttonReset.Location = '552, 51' + $buttonReset.Name = "buttonReset" + $buttonReset.Size = '48, 22' + $buttonReset.TabIndex = 13 + $buttonReset.Text = "Reset" + $buttonReset.UseVisualStyleBackColor = $True + $buttonReset.add_Click($buttonReset_Click) + # + # buttonFilter + # + $buttonFilter.Anchor = 'Top, Right' + $buttonFilter.Enabled = $False + $buttonFilter.Location = '600, 51' + $buttonFilter.Name = "buttonFilter" + $buttonFilter.Size = '62, 22' + $buttonFilter.TabIndex = 12 + $buttonFilter.Text = "Filter" + $buttonFilter.UseVisualStyleBackColor = $True + $buttonFilter.add_Click($buttonFilter_Click) + # + # textboxHighlight + # + $textboxHighlight.Anchor = 'Top, Right' + $textboxHighlight.Location = '601, 29' + $textboxHighlight.Name = "textboxHighlight" + $textboxHighlight.Size = '121, 20' + $textboxHighlight.TabIndex = 10 + # + # buttonHighlight + # + $buttonHighlight.Anchor = 'Top, Right' + $buttonHighlight.Location = '661, 51' + $buttonHighlight.Name = "buttonHighlight" + $buttonHighlight.Size = '62, 22' + $buttonHighlight.TabIndex = 9 + $buttonHighlight.Text = "Highlight" + $buttonHighlight.UseVisualStyleBackColor = $True + $buttonHighlight.add_Click($buttonHighlight_Click) + # # buttonMessage # $buttonMessage.Font = "Microsoft Sans Serif, 8.25pt" @@ -797,48 +1176,6 @@ rkJggg==') $buttonGetTsSession.UseVisualStyleBackColor = $True $buttonGetTsSession.add_Click($buttonGetTsSession_Click) # - # buttonExit - # - $buttonExit.Anchor = 'Top, Right' - #region Binary Data - $buttonExit.Image = [System.Convert]::FromBase64String(' -iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAAlwSFlz -AAAG6QAABukBM89dwwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAUpSURB -VEhLjdV9UMx5HAfwT2xhRFx7URpr6bKXoWjttaeHrbTV1SUVpqG7nKG5EhJOHC7m6B4Gh46cTseE -Oeb+8HCHmWNwZzzUtT3Yki1Jnp3Ttajjet/nU+3ouprznXk1Oz2835/fp9/+lgC8Mj5D9H6+5WGT -A02GQL1pkl5r0mm9TT7jvExqlXsR/3xvF0u7DeoJH82Bwjw8aazH7fpyVJb/govnfsTJo/sxe1aC -/EJrF3u7DeoJH82+vdthbazjgjJUlvVY8HeHPd0GdcbH1Y3Iu+O1Zs/uLXj80IKGulKYy87hwtlj -OHFECuJtBS/Yc/YXe6UCdSRRtQeRL7/W7MrbiPu3zbhhKUZFyRmcP3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i13j+xeprew -KpbbU6jt2LGR+aOpMc6VL5doTOw7wchMTcLM+MjW0aNUzxUKxZ/8fbl7bOupZdWskm3rHCphohfr -zexZH6bRD2h7pvRnY3XjvTDaY0Srvb1CHsfyaJA3l0xvK5D1XGVX2NbO4RIqgRLkxJTMlfFHAamY -Oxvp4GDPNx1lsoWM7w1KZR+yFDavw9wOBluBTO3ABjIXJoEa5sN0zI9NZN7Mkw1nrzNHJldqZ9tE -V+1fXhYMYPKHEiBBEqhlUiKfaGPZG0yuxpnJ1SrY/xbIkRVJST8mRa8xuRpZkxjKpHwwk8n7srbp -2X+C24H+ARNK1NuvDsfUAAAAAElFTkSuQmCC') - #endregion - $buttonExit.ImageAlign = 'TopCenter' - $buttonExit.Location = '558, 19' - $buttonExit.Name = "buttonExit" - $buttonExit.Size = '64, 45' - $buttonExit.TabIndex = 7 - $buttonExit.Text = "Exit" - $buttonExit.TextAlign = 'BottomCenter' - $buttonExit.UseVisualStyleBackColor = $True - $buttonExit.add_Click($buttonExit_Click) - # # buttonProcess # $buttonProcess.Font = "Microsoft Sans Serif, 8.25pt" @@ -889,9 +1226,9 @@ RK5CYII=') # $richtextboxStatus.Dock = 'Bottom' $richtextboxStatus.Font = "Consolas, 8.25pt" - $richtextboxStatus.Location = '0, 231' + $richtextboxStatus.Location = '0, 247' $richtextboxStatus.Name = "richtextboxStatus" - $richtextboxStatus.Size = '634, 71' + $richtextboxStatus.Size = '723, 71' $richtextboxStatus.TabIndex = 8 $richtextboxStatus.Text = "" # @@ -899,10 +1236,10 @@ RK5CYII=') # [void]$statusstrip1.Items.Add($toolstripstatuslabel1) [void]$statusstrip1.Items.Add($toolstripstatuslabel2) - $statusstrip1.Location = '0, 302' + $statusstrip1.Location = '0, 318' $statusstrip1.Name = "statusstrip1" $statusstrip1.RenderMode = 'Professional' - $statusstrip1.Size = '634, 22' + $statusstrip1.Size = '723, 22' $statusstrip1.TabIndex = 12 $statusstrip1.Text = "statusstrip1" # @@ -917,23 +1254,28 @@ RK5CYII=') [void]$contextmenustripTSSession.Items.Add($sendTSSessionToolStripMenuItem) [void]$contextmenustripTSSession.Items.Add($disconnectTSSessionToolStripMenuItem) [void]$contextmenustripTSSession.Items.Add($stopTSSessionToolStripMenuItem) + [void]$contextmenustripTSSession.Items.Add($toolstripseparator1) + [void]$contextmenustripTSSession.Items.Add($remoteDesktopToolStripMenuItem) + [void]$contextmenustripTSSession.Items.Add($remoteDesktopShadowIDToolStripMenuItem) + [void]$contextmenustripTSSession.Items.Add($remoteDesktopShadowControlToolStripMenuItem1) + [void]$contextmenustripTSSession.Items.Add($powerShellRemotingToolStripMenuItem) $contextmenustripTSSession.Name = "contextmenustrip1" $contextmenustripTSSession.RenderMode = 'System' $contextmenustripTSSession.ShowImageMargin = $False - $contextmenustripTSSession.Size = '151, 48' + $contextmenustripTSSession.Size = '233, 164' $contextmenustripTSSession.Text = "TSSession" # # disconnectTSSessionToolStripMenuItem # $disconnectTSSessionToolStripMenuItem.Name = "disconnectTSSessionToolStripMenuItem" - $disconnectTSSessionToolStripMenuItem.Size = '150, 22' + $disconnectTSSessionToolStripMenuItem.Size = '232, 22' $disconnectTSSessionToolStripMenuItem.Text = "Disconnect Session" $disconnectTSSessionToolStripMenuItem.add_Click($disconnectTSSessionToolStripMenuItem_Click) # # sendTSSessionToolStripMenuItem # $sendTSSessionToolStripMenuItem.Name = "sendTSSessionToolStripMenuItem" - $sendTSSessionToolStripMenuItem.Size = '150, 22' + $sendTSSessionToolStripMenuItem.Size = '232, 22' $sendTSSessionToolStripMenuItem.Text = "Send Message" $sendTSSessionToolStripMenuItem.ToolTipText = "Displays a message box to the selected session ID" $sendTSSessionToolStripMenuItem.add_Click($sendTSSessionToolStripMenuItem_Click) @@ -942,15 +1284,20 @@ RK5CYII=') # [void]$contextmenustripTSProcess.Items.Add($sendTSMessageToolStripMenuItem) [void]$contextmenustripTSProcess.Items.Add($stopTSProcessToolStripMenuItem) + [void]$contextmenustripTSProcess.Items.Add($toolstripseparator2) + [void]$contextmenustripTSProcess.Items.Add($remoteDesktopToolStripMenuItem1) + [void]$contextmenustripTSProcess.Items.Add($remoteDesktopShadowToolStripMenuItem) + [void]$contextmenustripTSProcess.Items.Add($remoteDesktopShadowControlToolStripMenuItem) + [void]$contextmenustripTSProcess.Items.Add($powerShellRemotingToolStripMenuItem1) $contextmenustripTSProcess.Name = "contextmenustripTSProcess" $contextmenustripTSProcess.RenderMode = 'System' $contextmenustripTSProcess.ShowImageMargin = $False - $contextmenustripTSProcess.Size = '125, 26' + $contextmenustripTSProcess.Size = '233, 142' # # sendTSMessageToolStripMenuItem # $sendTSMessageToolStripMenuItem.Name = "sendTSMessageToolStripMenuItem" - $sendTSMessageToolStripMenuItem.Size = '124, 22' + $sendTSMessageToolStripMenuItem.Size = '232, 22' $sendTSMessageToolStripMenuItem.Text = "Send Message" $sendTSMessageToolStripMenuItem.ToolTipText = "Displays a message box to the selected session ID" $sendTSMessageToolStripMenuItem.add_Click($sendTSSessionToolStripMenuItem_Click) @@ -958,7 +1305,7 @@ RK5CYII=') # stopTSProcessToolStripMenuItem # $stopTSProcessToolStripMenuItem.Name = "stopTSProcessToolStripMenuItem" - $stopTSProcessToolStripMenuItem.Size = '124, 22' + $stopTSProcessToolStripMenuItem.Size = '232, 22' $stopTSProcessToolStripMenuItem.Text = "Stop Process" $stopTSProcessToolStripMenuItem.ToolTipText = "Use Stop-TSProcess to terminate one or more processes" $stopTSProcessToolStripMenuItem.add_Click($stopTSProcessToolStripMenuItem_Click) @@ -966,12 +1313,13 @@ RK5CYII=') # stopTSSessionToolStripMenuItem # $stopTSSessionToolStripMenuItem.Name = "stopTSSessionToolStripMenuItem" - $stopTSSessionToolStripMenuItem.Size = '150, 22' + $stopTSSessionToolStripMenuItem.Size = '232, 22' $stopTSSessionToolStripMenuItem.Text = "Stop Session" $stopTSSessionToolStripMenuItem.add_Click($stopTSSessionToolStripMenuItem_Click) # # toolstripstatuslabel1 # + $toolstripstatuslabel1.Enabled = $False $toolstripstatuslabel1.Font = "Segoe UI, 9pt, style=Bold" $toolstripstatuslabel1.IsLink = $True $toolstripstatuslabel1.Name = "toolstripstatuslabel1" @@ -981,10 +1329,80 @@ RK5CYII=') # # toolstripstatuslabel2 # + $toolstripstatuslabel2.Enabled = $False $toolstripstatuslabel2.Font = "Segoe UI, 9pt, style=Bold" $toolstripstatuslabel2.Name = "toolstripstatuslabel2" $toolstripstatuslabel2.Size = '114, 17' $toolstripstatuslabel2.Text = "Francois-Xavier Cat" + # + # toolstripseparator1 + # + $toolstripseparator1.Name = "toolstripseparator1" + $toolstripseparator1.Size = '229, 6' + # + # remoteDesktopToolStripMenuItem + # + $remoteDesktopToolStripMenuItem.Name = "remoteDesktopToolStripMenuItem" + $remoteDesktopToolStripMenuItem.Size = '232, 22' + $remoteDesktopToolStripMenuItem.Text = "Remote Desktop" + $remoteDesktopToolStripMenuItem.add_Click($remoteDesktopToolStripMenuItem_Click) + # + # powerShellRemotingToolStripMenuItem + # + $powerShellRemotingToolStripMenuItem.Name = "powerShellRemotingToolStripMenuItem" + $powerShellRemotingToolStripMenuItem.Size = '232, 22' + $powerShellRemotingToolStripMenuItem.Text = "PowerShell Remoting" + $powerShellRemotingToolStripMenuItem.add_Click($powerShellRemotingToolStripMenuItem_Click) + # + # toolstripseparator2 + # + $toolstripseparator2.Name = "toolstripseparator2" + $toolstripseparator2.Size = '229, 6' + # + # remoteDesktopToolStripMenuItem1 + # + $remoteDesktopToolStripMenuItem1.Name = "remoteDesktopToolStripMenuItem1" + $remoteDesktopToolStripMenuItem1.Size = '232, 22' + $remoteDesktopToolStripMenuItem1.Text = "Remote Desktop" + $remoteDesktopToolStripMenuItem1.add_Click($remoteDesktopToolStripMenuItem_Click) + # + # powerShellRemotingToolStripMenuItem1 + # + $powerShellRemotingToolStripMenuItem1.Name = "powerShellRemotingToolStripMenuItem1" + $powerShellRemotingToolStripMenuItem1.Size = '232, 22' + $powerShellRemotingToolStripMenuItem1.Text = "PowerShell Remoting" + $powerShellRemotingToolStripMenuItem1.add_Click($powerShellRemotingToolStripMenuItem_Click) + # + # remoteDesktopShadowIDToolStripMenuItem + # + $remoteDesktopShadowIDToolStripMenuItem.Name = "remoteDesktopShadowIDToolStripMenuItem" + $remoteDesktopShadowIDToolStripMenuItem.Size = '232, 22' + $remoteDesktopShadowIDToolStripMenuItem.Text = "Remote Desktop (Shadow View)" + $remoteDesktopShadowIDToolStripMenuItem.add_Click($remoteDesktopShadowIDToolStripMenuItem_Click) + # + # remoteDesktopShadowToolStripMenuItem + # + $remoteDesktopShadowToolStripMenuItem.Name = "remoteDesktopShadowToolStripMenuItem" + $remoteDesktopShadowToolStripMenuItem.Size = '232, 22' + $remoteDesktopShadowToolStripMenuItem.Text = "Remote Desktop (Shadow View)" + $remoteDesktopShadowToolStripMenuItem.add_Click($remoteDesktopShadowIDToolStripMenuItem_Click) + # + # remoteDesktopShadowControlToolStripMenuItem + # + $remoteDesktopShadowControlToolStripMenuItem.Name = "remoteDesktopShadowControlToolStripMenuItem" + $remoteDesktopShadowControlToolStripMenuItem.Size = '232, 22' + $remoteDesktopShadowControlToolStripMenuItem.Text = "Remote Desktop (Shadow Control)" + $remoteDesktopShadowControlToolStripMenuItem.add_Click($remoteDesktopShadowControlToolStripMenuItem_Click) + # + # remoteDesktopShadowControlToolStripMenuItem1 + # + $remoteDesktopShadowControlToolStripMenuItem1.Name = "remoteDesktopShadowControlToolStripMenuItem1" + $remoteDesktopShadowControlToolStripMenuItem1.Size = '232, 22' + $remoteDesktopShadowControlToolStripMenuItem1.Text = "Remote Desktop (Shadow Control)" + $remoteDesktopShadowControlToolStripMenuItem1.add_Click($remoteDesktopShadowControlToolStripMenuItem_Click) + $contextmenustripTSProcess.ResumeLayout() + $contextmenustripTSSession.ResumeLayout() + $statusstrip1.ResumeLayout() $groupbox1.ResumeLayout() $MainForm.ResumeLayout() #endregion Generated Form Code @@ -1001,13 +1419,13 @@ RK5CYII=') $MainForm.add_Closing($Form_StoreValues_Closing) #Show the Form return $MainForm.ShowDialog() + } #endregion Source: MainForm.psf #region Source: Globals.ps1 #requires -version 3 - #-------------------------------------------- # Declare Global Variables and Functions here #-------------------------------------------- @@ -1034,7 +1452,7 @@ RK5CYII=') if (-not(Test-Path $CassiaPath)){Write-Warning -Message "The file Cassia.dll is missing. The Script can't continue without this file";exit} [Reflection.Assembly]::LoadFile($CassiaPath) | Out-Null - + # From WinFormPS function Append-RichtextboxStatus{ PARAM( [Parameter(Mandatory=$true)] @@ -1070,22 +1488,64 @@ RK5CYII=') function Set-DataGridView { + <# + .SYNOPSIS + This function helps you edit the datagridview control + + .DESCRIPTION + This function helps you edit the datagridview control + + .EXAMPLE + Set-DataGridView -DataGridView $datagridview1 -ProperFormat -FontFamily $listboxFontFamily.Text -FontSize $listboxFontSize.Text + + .EXAMPLE + Set-DataGridView -DataGridView $datagridview1 -AlternativeRowColor -BackColor 'AliceBlue' -ForeColor 'Black' + + .EXAMPLE + Set-DataGridViewRowHeader -DataGridView $datagridview1 -HideRowHeader + + .EXAMPLE + Set-DataGridViewRowHeader -DataGridView $datagridview1 -ShowRowHeader + + .NOTES + Author: Francois-Xavier Cat + Twitter:@LazyWinAdm + WWW: lazywinadmin.com + #> + + [CmdletBinding()] PARAM ( [ValidateNotNull()] [Parameter(Mandatory = $true)] [System.Windows.Forms.DataGridView]$DataGridView, - [Parameter(ParameterSetName = "AlternativeRowColor")] + [Parameter(Mandatory = $true, ParameterSetName = "AlternativeRowColor")] [Switch]$AlternativeRowColor, + [Parameter(ParameterSetName = "DefaultRowColor")] + [Switch]$DefaultRowColor, + [Parameter(Mandatory = $true, ParameterSetName = "AlternativeRowColor")] + [Parameter(ParameterSetName = "DefaultRowColor")] [System.Drawing.Color]$ForeColor, [Parameter(Mandatory = $true, ParameterSetName = "AlternativeRowColor")] + [Parameter(ParameterSetName = "DefaultRowColor")] [System.Drawing.Color]$BackColor, + [Parameter(Mandatory = $true, ParameterSetName = "Proper")] + [Switch]$ProperFormat, + + [Parameter(ParameterSetName = "Proper")] + [String]$FontFamily = "Consolas", + [Parameter(ParameterSetName = "Proper")] - [Switch]$ProperFormat + [Int]$FontSize = 10, + + [Parameter(ParameterSetName = "HideRowHeader")] + [Switch]$HideRowHeader, + [Parameter(ParameterSetName = "ShowRowHeader")] + [Switch]$ShowRowHeader ) PROCESS { @@ -1095,11 +1555,18 @@ RK5CYII=') $DataGridView.AlternatingRowsDefaultCellStyle.BackColor = $BackColor } + if ($psboundparameters['DefaultRowColor']) + { + $DataGridView.RowsDefaultCellStyle.ForeColor = $ForeColor + $DataGridView.RowsDefaultCellStyle.BackColor = $BackColor + } + if ($psboundparameters['ProperFormat']) { #$Font = New-Object -TypeName System.Drawing.Font -ArgumentList "Segoi UI", 10 - $Font = New-Object -TypeName System.Drawing.Font -ArgumentList "Consolas", 10 + $Font = New-Object -TypeName System.Drawing.Font -ArgumentList $FontFamily, $FontSize + #[System.Drawing.FontStyle]::Bold $DataGridView.ColumnHeadersBorderStyle = 'Raised' @@ -1108,11 +1575,253 @@ RK5CYII=') $DataGridView.AllowUserToResizeRows = $false $datagridview.DefaultCellStyle.font = $Font } + + if ($psboundparameters['HideRowHeader']) + { + $DataGridView.RowHeadersVisible = $false + } + if ($psboundparameters['ShowRowHeader']) + { + $DataGridView.RowHeadersVisible = $true + } } - } + }#Set-DataGridView - # SAPIEN Cmdlets/Functions + function Reset-DataGridViewFormat + { + <# + .SYNOPSIS + The Reset-DataGridViewFormat function will reset the format of a datagridview control + + .DESCRIPTION + The Reset-DataGridViewFormat function will reset the format of a datagridview control + + .PARAMETER DataGridView + Specifies the DataGridView Control. + + .EXAMPLE + PS C:\> Reset-DataGridViewFormat -DataGridView $DataGridViewObj + + .NOTES + Author: Francois-Xavier Cat + Twitter:@LazyWinAdm + WWW: lazywinadmin.com + #> + [CmdletBinding()] + PARAM ( + [Parameter(Mandatory = $true)] + [System.Windows.Forms.DataGridView]$DataGridView) + PROCESS + { + $DataSource = $DataGridView.DataSource + $DataGridView.DataSource = $null + $DataGridView.DataSource = $DataSource + + #$DataGridView.RowsDefaultCellStyle.BackColor = 'White' + #$DataGridView.RowsDefaultCellStyle.ForeColor = 'Black' + $DataGridView.RowsDefaultCellStyle = $null + $DataGridView.AlternatingRowsDefaultCellStyle = $null + } + }#Reset-DataGridViewFormat + + function Find-DataGridViewValue + { + <# + .SYNOPSIS + The Find-DataGridViewValue function helps you to find a specific value and select the cell, row or to set a fore and back color. + + .DESCRIPTION + The Find-DataGridViewValue function helps you to find a specific value and select the cell, row or to set a fore and back color. + + .PARAMETER DataGridView + Specifies the DataGridView Control to use + + .PARAMETER RowBackColor + Specifies the back color of the row to use + + .PARAMETER RowForeColor + Specifies the fore color of the row to use + + .PARAMETER SelectCell + Specifies to select only the cell when the value is found + + .PARAMETER SelectRow + Specifies to select the entire row when the value is found + + .PARAMETER Value + Specifies the value to search + + .EXAMPLE + PS C:\> Find-DataGridViewValue -DataGridView $datagridview1 -Value $textbox1.Text + + This will find the value and select the cell(s) + + .EXAMPLE + PS C:\> Find-DataGridViewValue -DataGridView $datagridview1 -Value $textbox1.Text -RowForeColor 'Red' -RowBackColor 'Black' + + This will find the value and color the fore and back of the row + .EXAMPLE + PS C:\> Find-DataGridViewValue -DataGridView $datagridview1 -Value $textbox1.Text -SelectRow + + This will find the value and select the entire row + + .NOTES + Francois-Xavier Cat + @lazywinadm + www.lazywinadmin.com + #> + [CmdletBinding(DefaultParameterSetName = "Cell")] + PARAM ( + [Parameter(Mandatory = $true)] + [System.Windows.Forms.DataGridView]$DataGridView, + + [ValidateNotNull()] + [Parameter(Mandatory = $true)] + [String]$Value, + [Parameter(ParameterSetName = "Cell")] + [Switch]$SelectCell, + + [Parameter(ParameterSetName = "Row")] + [Switch]$SelectRow, + + #[Parameter(ParameterSetName = "Column")] + #[Switch]$SelectColumn, + [Parameter(ParameterSetName = "RowColor")] + [system.Drawing.Color]$RowForeColor, + [Parameter(ParameterSetName = "RowColor")] + [system.Drawing.Color]$RowBackColor + ) + + PROCESS + { + $DataGridView.ClearSelection() + + FOR ([int]$i = 0; $i -lt $DataGridView.RowCount; $i++) + { + FOR ([int] $j = 0; $j -lt $DataGridView.ColumnCount; $j++) + { + $CurrentCell = $dataGridView.Rows[$i].Cells[$j] + + #if ((-not $CurrentCell.Value.Equals([DBNull]::Value)) -and ($CurrentCell.Value.ToString() -like "*$Value*")) + if ($CurrentCell.Value.ToString() -match $Value) + { + + # Row Selection + IF ($PSBoundParameters['SelectRow']) + { + $dataGridView.Rows[$i].Selected = $true + } + + <# + # Column Selection + IF ($PSBoundParameters['SelectColumn']) + { + #$DataGridView.Columns[$($CurrentCell.ColumnIndex)].Selected = $true + #$DataGridView.Columns[$j].Selected = $true + #$CurrentCell.DataGridView.Columns[$j].Selected = $true + } + #> + + # Row Fore Color + IF ($PSBoundParameters['RowForeColor']) + { + $dataGridView.Rows[$i].DefaultCellStyle.ForeColor = $RowForeColor + } + # Row Back Color + IF ($PSBoundParameters['RowBackColor']) + { + $dataGridView.Rows[$i].DefaultCellStyle.BackColor = $RowBackColor + } + + # Cell Selection + ELSEIF (-not ($PSBoundParameters['SelectRow']) -and -not ($PSBoundParameters['SelectColumn'])) + { + $CurrentCell.Selected = $true + } + }#IF not empty and contains value + }#For Each column + }#For Each Row + }#PROCESS + }#Find-DataGridViewValue + + function Set-DataGridViewFilter + { + <# + .SYNOPSIS + The function Set-DataGridViewFilter helps to only show specific entries with a specific value + + .DESCRIPTION + The function Set-DataGridViewFilter helps to only show specific entries with a specific value. + The data needs to be in a DataTable Object. You can use ConvertTo-DataTable to convert your + PowerShell object into a DataTable object. + + .PARAMETER AllColumns + Specifies to search all the column + + .PARAMETER ColumnName + Specifies to search in a specific column name + + .PARAMETER DataGridView + Specifies the DataGridView control where the data will be filtered + + .PARAMETER DataTable + Specifies the DataTable object that is most likely the original source of the DataGridView + + .PARAMETER Filter + Specifies the string to search + + .EXAMPLE + PS C:\> Set-DataGridViewFilter -DataGridView $datagridview1 -DataTable $ProcessesDT -AllColumns -Filter $textbox1.Text + + .EXAMPLE + PS C:\> Set-DataGridViewFilter -DataGridView $datagridview1 -DataTable $ProcessesDT -ColumnName "Name" -Filter $textbox1.Text + + .NOTES + Author: Francois-Xavier Cat + Twitter:@LazyWinAdm + WWW: lazywinadmin.com + #> + PARAM ( + [Parameter(Mandatory = $true)] + [System.Windows.Forms.DataGridView]$DataGridView, + [Parameter(Mandatory = $true)] + [System.Data.DataTable]$DataTable, + [Parameter(Mandatory = $true)] + [String]$Filter, + + [Parameter(Mandatory = $true, ParameterSetName = "OneColumn")] + [String]$ColumnName, + [Parameter(Mandatory = $true, ParameterSetName = "AllColumns")] + [Switch]$AllColumns + ) + PROCESS + { + $Filter = $Filter.ToString() + + IF ($PSBoundParameters['AllColumns']) + { + FOREACH ($Column in $DataTable.Columns) + { + #$RowFilter += "Convert("+$($Column.ColumnName)+",'system.string') Like '%"{1}%' OR " -f $Column.ColumnName, $Filter + $RowFilter += "Convert($($Column.ColumnName),'system.string') Like '%$Filter%' OR " + } + + # Remove the last 'OR' + $RowFilter = $RowFilter -replace " OR $", '' + + #Append-RichtextboxStatus -Message $RowFilter + } + IF ($PSBoundParameters['ColumnName']) + { + $RowFilter = "$ColumnName LIKE '%$Filter%'" + } + + $DataTable.defaultview.rowfilter = $RowFilter + Load-DataGridView -DataGridView $DataGridView -Item $DataTable + } + END { Remove-Variable -Name $RowFilter -ErrorAction 'SilentlyContinue' | Out-Null } + }#Set-DataGridViewFilter function ConvertTo-DataTable { @@ -1292,6 +2001,62 @@ RK5CYII=') $DataGridView.ResumeLayout() } + function Clear-DataGridViewSelection + { + PARAM ( + [Parameter(Mandatory = $true)] + [System.Windows.Forms.DataGridView]$DataGridView + ) + $DataGridView.ClearSelection() + } + + function New-MessageBox + { + <# + .SYNOPSIS + The New-MessageBox functio will show a message box to the user + + .DESCRIPTION + The New-MessageBox functio will show a message box to the user + + .PARAMETER Message + Specifies the message to show + + .PARAMETER Title + Specifies the title of the message box + + .PARAMETER Buttons + Specifies which button to add. Just press tab to see the choices + + .PARAMETER Icon + Specifies the icon to show. Just press tab to see the choices + + .EXAMPLE + PS C:\> New-MessageBox -Message "Hello World" -Title "First Message" -Buttons "RetryCancel" -Icon "Asterix" + + .NOTES + Author: Francois-Xavier Cat + Twitter:@LazyWinAdm + WWW: lazywinadmin.com + #> + [CmdletBinding()] + PARAM ( + + [String]$Message, + [String]$Title, + [System.Windows.Forms.MessageBoxButtons]$Buttons = "OK", + [System.Windows.Forms.MessageBoxIcon]$Icon = "None" + ) + BEGIN + { + Add-Type -AssemblyName System.Windows.Forms + } + PROCESS + { + [System.Windows.Forms.MessageBox]::Show($Message, $Title, $Buttons, $Icon) + } + }#New-MessageBox + # PSTerminalServices Module by Shay Levy $script:Server='localhost' function Get-TSSession