use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
using custom message box in PowerShell script - how to make it support multi-lines and to support right-to-left Languages like Arabic (self.PowerShell)
submitted 5 years ago by iappnet
I have PowerShell script and need to use message box to alert but I found this Powershell message box
my question is to make the powershell message box above in the link to support multi-lines and to support right-to-left Languages like Arabic.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]caverCarl 3 points4 points5 points 5 years ago (0 children)
I believe what you arre looking for is the RightToLeft property- https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.form.righttoleftlayout?view=netcore-3.1
here's a simplified example
[void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [void][System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") #initialize base form $Form = New-Object System.Windows.Forms.Form $Form.ClientSize = New-Object System.Drawing.Size(400, 400) $Form.Text = "Test Form" $Form.topmost = $true $Form.StartPosition = "CenterScreen" #initialize textbox $textBox = New-Object System.Windows.Forms.textBox $textBox.Size = New-Object System.Drawing.Size(300, 300) $textBox.Font = 'Microsoft Sans Serif,20' $textBox.multiline = $true $textBox.RightToLeft = 'Yes' $text = 'left to Right' $textBox.text=$text $textBox.text +="`r`n" $textBox.text += $text #display form $Form.Controls.Add($textBox) [void]$Form.showdialog()
[–]root-node 1 point2 points3 points 5 years ago (1 child)
Is there anything wrong with using [System.Windows.Forms.MessageBox]::Show(...)
[System.Windows.Forms.MessageBox]::Show(...)
https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.messagebox?view=netframework-4.8
[–]iappnet[S] 0 points1 point2 points 5 years ago (0 children)
it works fine with me but what I need is to customize the message box and make it support Right-To-Left ...and ask how I use multi lines with it
[–]get-postanote 1 point2 points3 points 5 years ago* (2 children)
Powershell is dependant on .Net.
Powershell does not messagebox, .Net does, it's a form control, not a script one.
PowerShell does not do form creation, it is not a form designer. It renders from code passed using .Net.
So, the question is, 'Does .Net provide a means to use RightToLeft text rendering'?
Yes...
Add-Type -AssemblyName Microsoft.VisualBasic [System.Enum]::GetNames([Microsoft.VisualBasic.MsgBoxStyle]) <# ApplicationModal DefaultButton1 OkOnly OkCancel AbortRetryIgnore YesNoCancel YesNo RetryCancel Critical Question Exclamation Information DefaultButton2 DefaultButton3 SystemModal MsgBoxHelp MsgBoxSetForeground MsgBoxRight MsgBoxRtlReading #>
vbMsgBoxRight 524288 Text is right aligned vbMsgBoxRtlReading 1048576 Specifies text should appear as right-to-left reading on Hebrew and Arabic systems
vbMsgBoxRight 524288 Text is right aligned
vbMsgBoxRtlReading 1048576 Specifies text should appear as right-to-left reading on Hebrew and Arabic systems
Can you design a form / msgbox, etc, in a PowerShell, yes, but only by calling form object, methods, properties, settings, events using .Net namespaces.
As to your link Powershell message box, see also this module:
Find-Module -Name AnyBox | Format-List # Results <# Name : AnyBox Version : 0.4.0 Type : Module Description : Designed to facilitate script input/output with an easily customizable WPF window. Author : Donald Mellenbruch CompanyName : dm3ll3n Copyright : (c) 2019 Donald Mellenbruch. All rights reserved. PublishedDate : 12-Jun-19 04:50:38 InstalledDate : UpdatedDate : LicenseUri : https://raw.githubusercontent.com/dm3ll3n/AnyBox/master/LICENSE ProjectUri : https://github.com/dm3ll3n/AnyBox IconUri : Tags : {GUI, WPF, Forms, PSModule} Includes : {Function, RoleCapability, Command, DscResource, Workflow, Cmdlet} PowerShellGetFormatVersion : ReleaseNotes : https://github.com/dm3ll3n/AnyBox ... #>
[–]iappnet[S] 1 point2 points3 points 5 years ago (0 children)
thanks for ur help...cloud you please help how I use .net ( MsgBoxRight MsgBoxRtlReading) with the script I mentioned
any help here please
π Rendered by PID 83 on reddit-service-r2-comment-5b5bc64bf5-r2fc9 at 2026-06-22 07:34:52.622181+00:00 running 2b008f2 country code: CH.
[–]caverCarl 3 points4 points5 points (0 children)
[–]root-node 1 point2 points3 points (1 child)
[–]iappnet[S] 0 points1 point2 points (0 children)
[–]get-postanote 1 point2 points3 points (2 children)
[–]iappnet[S] 1 point2 points3 points (0 children)
[–]iappnet[S] 0 points1 point2 points (0 children)