{"id":1426,"date":"2015-07-12T18:32:15","date_gmt":"2015-07-12T17:32:15","guid":{"rendered":"https:\/\/www.autoitconsulting.com\/site\/?p=1426"},"modified":"2025-07-14T23:13:58","modified_gmt":"2025-07-14T22:13:58","slug":"autoit-cmdlets-for-windows-powershell","status":"publish","type":"post","link":"https:\/\/www.autoitconsulting.com\/site\/scripting\/autoit-cmdlets-for-windows-powershell\/","title":{"rendered":"AutoIt Cmdlets for Windows PowerShell"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Overview<\/h2>\n\n\n\n<p>The newest versions of the <a href=\"https:\/\/www.autoitscript.com\/site\/autoit\/\" target=\"_blank\" rel=\"noopener\">AutoIt scripting language<\/a> now come with a bonus for PowerShell users. A set of native PowerShell Cmdlets! This allows you to add the unique features of AutoIt &#8211; window manipulation and keystroke simulation &#8211; to your usual PowerShell scripts. As an additional bonus, the AutoIt PowerShell Cmdlets and Assemblies are digitally signed so they can be used with the more strict execution policies. The Cmdlets will also run natively with x86 and x64 versions of PowerShell!<\/p>\n\n\n\n<p>This post will show how to use the AutoIt PowerShell Cmdlets to open notepad and type in some text in the edit control.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installation<\/h2>\n\n\n\n<p>First download the <a href=\"https:\/\/www.autoitscript.com\/site\/autoit\/downloads\/\" target=\"_blank\" rel=\"noopener\">latest version of AutoIt<\/a>. You can run the full installer, or just download the zip file to get the required bits. Running the installer has the advantage of automatically registering the AutoIt Cmdlets. The files you need are as follows (get them from the zip file or the Program Files folder after installation):<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>AutoItX.psd1<\/li>\n\n\n\n<li>AutoItX3.PowerShell.dll<\/li>\n\n\n\n<li>AutoItX3.Assembly.dll<\/li>\n\n\n\n<li>AutoItX3.dll<\/li>\n\n\n\n<li>AutoItX3_x64.dll<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Usage<\/h2>\n\n\n\n<p>To use the Cmdlets open a PowerShell cmd prompt and enter:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#1E1E1E;font-style:italic;color:#D4D4D4\"><span style=\"border-bottom:1px solid rgba(234, 191, 191, 0.2)\">PowerShell<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>Import-Module .\\AutoItX.psd1<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">Import-Module<\/span><span style=\"color: #D4D4D4\"> .\\AutoItX.psd1<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Now you can get a list of available AutoIt Cmdlets by doing <strong>Get-Command *AU3*<\/strong>:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#1E1E1E;font-style:italic;color:#D4D4D4\"><span style=\"border-bottom:1px solid rgba(234, 191, 191, 0.2)\">PowerShell<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>PS> Get-Command *AU3*\n\nName                              Category  Module \n----                              --------  ------ \nInvoke-AU3MouseWheel              Cmdlet    AutoItX\nMove-AU3Mouse                     Cmdlet    AutoItX\nInvoke-AU3MouseClickDrag          Cmdlet    AutoItX\nGet-AU3MouseCursor                Cmdlet    AutoItX\nInvoke-AU3MouseUp                 Cmdlet    AutoItX\nAssert-AU3WinActive               Cmdlet    AutoItX\nAssert-AU3WinExists               Cmdlet    AutoItX\nAssert-AU3IsAdmin                 Cmdlet    AutoItX\nInvoke-AU3Shutdown                Cmdlet    AutoItX\nSend-AU3ControlKey                Cmdlet    AutoItX\nInvoke-AU3MouseDown               Cmdlet    AutoItX\nInvoke-AU3MouseClick              Cmdlet    AutoItX\nInvoke-AU3ControlTreeView         Cmdlet    AutoItX\nInvoke-AU3ControlListView         Cmdlet    AutoItX\nInvoke-AU3ControlCommand          Cmdlet    AutoItX\nInvoke-AU3ControlClick            Cmdlet    AutoItX\nMove-AU3Control                   Cmdlet    AutoItX\nSet-AU3ControlText                Cmdlet    AutoItX\nShow-AU3Control                   Cmdlet    AutoItX\nHide-AU3Control                   Cmdlet    AutoItX\nGet-AU3ControlText                Cmdlet    AutoItX\nGet-AU3ControlFocus               Cmdlet    AutoItX\nSet-AU3ControlFocus               Cmdlet    AutoItX\nDisable-AU3Control                Cmdlet    AutoItX\nEnable-AU3Control                 Cmdlet    AutoItX\nGet-AU3StatusbarText              Cmdlet    AutoItX\nInvoke-AU3RunAsWait               Cmdlet    AutoItX\nInvoke-AU3RunAs                   Cmdlet    AutoItX\nInvoke-AU3RunWait                 Cmdlet    AutoItX\nInvoke-AU3Run                     Cmdlet    AutoItX\nSet-AU3Clip                       Cmdlet    AutoItX\nGet-AU3Clip                       Cmdlet    AutoItX\nSet-AU3WinTrans                   Cmdlet    AutoItX\nSet-AU3WinTitle                   Cmdlet    AutoItX\nSet-AU3WinState                   Cmdlet    AutoItX\nSet-AU3WinOnTop                   Cmdlet    AutoItX\nMove-AU3Win                       Cmdlet    AutoItX\nShow-AU3WinMinimizeAllUndo        Cmdlet    AutoItX\nShow-AU3WinMinimizeAll            Cmdlet    AutoItX\nGet-AU3WinState                   Cmdlet    AutoItX\nGet-AU3WinProcess                 Cmdlet    AutoItX\nGet-AU3WinClassList               Cmdlet    AutoItX\nGet-AU3WinCaretPos                Cmdlet    AutoItX\nGet-AU3WinClientSize              Cmdlet    AutoItX\nGet-AU3ControlPos                 Cmdlet    AutoItX\nGet-AU3ControlHandle              Cmdlet    AutoItX\nGet-AU3MousePos                   Cmdlet    AutoItX\nGet-AU3WinPos                     Cmdlet    AutoItX\nGet-AU3WinHandle                  Cmdlet    AutoItX\nGet-AU3ErrorCode                  Cmdlet    AutoItX\nInitialize-AU3                    Cmdlet    AutoItX\nShow-AU3WinActivate               Cmdlet    AutoItX\nClose-AU3Win                      Cmdlet    AutoItX\nWait-AU3WinClose                  Cmdlet    AutoItX\nWait-AU3WinNotActive              Cmdlet    AutoItX\nSet-AU3Option                     Cmdlet    AutoItX\nSend-AU3Key                       Cmdlet    AutoItX\nWait-AU3Win                       Cmdlet    AutoItX\nWait-AU3WinActive                 Cmdlet    AutoItX\nGet-AU3WinTitle                   Cmdlet    AutoItX\nGet-AU3WinText                    Cmdlet    AutoItX<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D4D4D4\">PS&gt; <\/span><span style=\"color: #DCDCAA\">Get-Command<\/span><span style=\"color: #D4D4D4\"> *AU3*<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">Name                              Category  Module <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">----                              --------  ------ <\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Invoke-AU3MouseWheel<\/span><span style=\"color: #D4D4D4\">              Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Move-AU3Mouse<\/span><span style=\"color: #D4D4D4\">                     Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Invoke-AU3MouseClickDrag<\/span><span style=\"color: #D4D4D4\">          Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3MouseCursor<\/span><span style=\"color: #D4D4D4\">                Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Invoke-AU3MouseUp<\/span><span style=\"color: #D4D4D4\">                 Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Assert-AU3WinActive<\/span><span style=\"color: #D4D4D4\">               Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Assert-AU3WinExists<\/span><span style=\"color: #D4D4D4\">               Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Assert-AU3IsAdmin<\/span><span style=\"color: #D4D4D4\">                 Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Invoke-AU3Shutdown<\/span><span style=\"color: #D4D4D4\">                Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Send-AU3ControlKey<\/span><span style=\"color: #D4D4D4\">                Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Invoke-AU3MouseDown<\/span><span style=\"color: #D4D4D4\">               Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Invoke-AU3MouseClick<\/span><span style=\"color: #D4D4D4\">              Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Invoke-AU3ControlTreeView<\/span><span style=\"color: #D4D4D4\">         Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Invoke-AU3ControlListView<\/span><span style=\"color: #D4D4D4\">         Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Invoke-AU3ControlCommand<\/span><span style=\"color: #D4D4D4\">          Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Invoke-AU3ControlClick<\/span><span style=\"color: #D4D4D4\">            Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Move-AU3Control<\/span><span style=\"color: #D4D4D4\">                   Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Set-AU3ControlText<\/span><span style=\"color: #D4D4D4\">                Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Show-AU3Control<\/span><span style=\"color: #D4D4D4\">                   Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Hide-AU3Control<\/span><span style=\"color: #D4D4D4\">                   Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3ControlText<\/span><span style=\"color: #D4D4D4\">                Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3ControlFocus<\/span><span style=\"color: #D4D4D4\">               Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Set-AU3ControlFocus<\/span><span style=\"color: #D4D4D4\">               Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Disable-AU3Control<\/span><span style=\"color: #D4D4D4\">                Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Enable-AU3Control<\/span><span style=\"color: #D4D4D4\">                 Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3StatusbarText<\/span><span style=\"color: #D4D4D4\">              Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Invoke-AU3RunAsWait<\/span><span style=\"color: #D4D4D4\">               Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Invoke-AU3RunAs<\/span><span style=\"color: #D4D4D4\">                   Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Invoke-AU3RunWait<\/span><span style=\"color: #D4D4D4\">                 Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Invoke-AU3Run<\/span><span style=\"color: #D4D4D4\">                     Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Set-AU3Clip<\/span><span style=\"color: #D4D4D4\">                       Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3Clip<\/span><span style=\"color: #D4D4D4\">                       Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Set-AU3WinTrans<\/span><span style=\"color: #D4D4D4\">                   Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Set-AU3WinTitle<\/span><span style=\"color: #D4D4D4\">                   Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Set-AU3WinState<\/span><span style=\"color: #D4D4D4\">                   Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Set-AU3WinOnTop<\/span><span style=\"color: #D4D4D4\">                   Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Move-AU3Win<\/span><span style=\"color: #D4D4D4\">                       Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Show-AU3WinMinimizeAllUndo<\/span><span style=\"color: #D4D4D4\">        Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Show-AU3WinMinimizeAll<\/span><span style=\"color: #D4D4D4\">            Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3WinState<\/span><span style=\"color: #D4D4D4\">                   Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3WinProcess<\/span><span style=\"color: #D4D4D4\">                 Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3WinClassList<\/span><span style=\"color: #D4D4D4\">               Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3WinCaretPos<\/span><span style=\"color: #D4D4D4\">                Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3WinClientSize<\/span><span style=\"color: #D4D4D4\">              Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3ControlPos<\/span><span style=\"color: #D4D4D4\">                 Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3ControlHandle<\/span><span style=\"color: #D4D4D4\">              Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3MousePos<\/span><span style=\"color: #D4D4D4\">                   Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3WinPos<\/span><span style=\"color: #D4D4D4\">                     Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3WinHandle<\/span><span style=\"color: #D4D4D4\">                  Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3ErrorCode<\/span><span style=\"color: #D4D4D4\">                  Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Initialize-AU3<\/span><span style=\"color: #D4D4D4\">                    Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Show-AU3WinActivate<\/span><span style=\"color: #D4D4D4\">               Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Close-AU3Win<\/span><span style=\"color: #D4D4D4\">                      Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Wait-AU3WinClose<\/span><span style=\"color: #D4D4D4\">                  Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Wait-AU3WinNotActive<\/span><span style=\"color: #D4D4D4\">              Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Set-AU3Option<\/span><span style=\"color: #D4D4D4\">                     Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Send-AU3Key<\/span><span style=\"color: #D4D4D4\">                       Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Wait-AU3Win<\/span><span style=\"color: #D4D4D4\">                       Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Wait-AU3WinActive<\/span><span style=\"color: #D4D4D4\">                 Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3WinTitle<\/span><span style=\"color: #D4D4D4\">                   Cmdlet    AutoItX<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Get-AU3WinText<\/span><span style=\"color: #D4D4D4\">                    Cmdlet    AutoItX<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Example<\/h2>\n\n\n\n<p>I&#8217;ll show how to use the Cmdlets using a simple example that will open notepad.exe and modify the edit window by setting the text and simulating some keystrokes. First create a blank PowerShell script called&nbsp;<strong>notepad_example.ps1<\/strong>&nbsp;in the same folder as the AutoItX components above and open it for editing.<\/p>\n\n\n\n<p>Now we want to import the PowerShell module which is&nbsp;<strong>AutoItX.psd1<\/strong>. Enter the following in the script:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#1E1E1E;font-style:italic;color:#D4D4D4\"><span style=\"border-bottom:1px solid rgba(234, 191, 191, 0.2)\">PowerShell<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>Import-Module .\\AutoItX.psd1<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">Import-Module<\/span><span style=\"color: #D4D4D4\"> .\\AutoItX.psd1<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>We want to run notepad.exe:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#1E1E1E;font-style:italic;color:#D4D4D4\"><span style=\"border-bottom:1px solid rgba(234, 191, 191, 0.2)\">PowerShell<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>Invoke-AU3Run -Program notepad.exe<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">Invoke-AU3Run<\/span><span style=\"color: #D4D4D4\"> -Program <\/span><span style=\"color: #DCDCAA\">notepad.exe<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>After notepad opens we want to wait for the notepad &#8220;Untitled -Notepad&#8221; window to appear. You might need to change the title for non-English versions of Windows:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#1E1E1E;font-style:italic;color:#D4D4D4\"><span style=\"border-bottom:1px solid rgba(234, 191, 191, 0.2)\">PowerShell<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>$notepadTitle = \"Untitled - Notepad\"\nWait-AU3Win -Title $notepadTitle\n$winHandle = Get-AU3WinHandle -Title $notepadTitle<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #9CDCFE\">$notepadTitle<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">&quot;Untitled - Notepad&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Wait-AU3Win<\/span><span style=\"color: #D4D4D4\"> -Title <\/span><span style=\"color: #9CDCFE\">$notepadTitle<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$winHandle<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #DCDCAA\">Get-AU3WinHandle<\/span><span style=\"color: #D4D4D4\"> -Title <\/span><span style=\"color: #9CDCFE\">$notepadTitle<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>The Get-AU3WinHandle returns a native <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/ms633515(v=vs.85).aspx\" target=\"_blank\" rel=\"noopener\">Win32 handle<\/a> to the notepad window. We can use this handle in many other AutoIt functions and it uniquely identifies the window which is much more reliable than constantly using a windows title. If you have obtained a window handle using any other Win32 function you can use it with AutoIt.<\/p>\n\n\n\n<p>After obtaining the handle to the notepad window we want to ensure that the window is active and then get a handle to the Edit Control. Using the <strong>AU3Info.exe<\/strong> tool that comes with AutoIt we can find that the name of the edit control in notepad is <strong>Edit1<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#1E1E1E;font-style:italic;color:#D4D4D4\"><span style=\"border-bottom:1px solid rgba(234, 191, 191, 0.2)\">PowerShell<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>Show-AU3WinActivate -WinHandle $winHandle\n$controlHandle = Get-AU3ControlHandle -WinHandle $winhandle -Control \"Edit1\"<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">Show-AU3WinActivate<\/span><span style=\"color: #D4D4D4\"> -WinHandle <\/span><span style=\"color: #9CDCFE\">$winHandle<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$controlHandle<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #DCDCAA\">Get-AU3ControlHandle<\/span><span style=\"color: #D4D4D4\"> -WinHandle <\/span><span style=\"color: #9CDCFE\">$winhandle<\/span><span style=\"color: #D4D4D4\"> -Control <\/span><span style=\"color: #CE9178\">&quot;Edit1&quot;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Now that we have a handle to the edit control we can set text in two ways: Directly (Set-AU3Controltext) or with simulated keystrokes (Send-AU3ControlKey):<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#1E1E1E;font-style:italic;color:#D4D4D4\"><span style=\"border-bottom:1px solid rgba(234, 191, 191, 0.2)\">PowerShell<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>Set-AU3ControlText -ControlHandle $controlHandle -NewText \"Hello! This is being controlled by AutoIt and PowerShell!\" -WinHandle $winHandle\nSend-AU3ControlKey -ControlHandle $controlHandle -Key \"{ENTER}simulate key strokes - line 1\" -WinHandle $winHandle<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">Set-AU3ControlText<\/span><span style=\"color: #D4D4D4\"> -ControlHandle <\/span><span style=\"color: #9CDCFE\">$controlHandle<\/span><span style=\"color: #D4D4D4\"> -NewText <\/span><span style=\"color: #CE9178\">&quot;Hello! This is being controlled by AutoIt and PowerShell!&quot;<\/span><span style=\"color: #D4D4D4\"> -WinHandle <\/span><span style=\"color: #9CDCFE\">$winHandle<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Send-AU3ControlKey<\/span><span style=\"color: #D4D4D4\"> -ControlHandle <\/span><span style=\"color: #9CDCFE\">$controlHandle<\/span><span style=\"color: #D4D4D4\"> -Key <\/span><span style=\"color: #CE9178\">&quot;{ENTER}simulate key strokes - line 1&quot;<\/span><span style=\"color: #D4D4D4\"> -WinHandle <\/span><span style=\"color: #9CDCFE\">$winHandle<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Now let&#8217;s see what the entire script looks like:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#1E1E1E;font-style:italic;color:#D4D4D4\"><span style=\"border-bottom:1px solid rgba(234, 191, 191, 0.2)\">PowerShell<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly># Import the AutoIt PowerShell module\nImport-Module .\\AutoItX.psd1\n\n# Run notepad.exe\nInvoke-AU3Run -Program notepad.exe\n\n# Wait for an untitled notepad window and get the handle\n$notepadTitle = \"Untitled - Notepad\"\nWait-AU3Win -Title $notepadTitle\n$winHandle = Get-AU3WinHandle -Title $notepadTitle\n\n# Activate the window\nShow-AU3WinActivate -WinHandle $winHandle\n\n# Get the handle of the notepad text control for reliable operations\n$controlHandle = Get-AU3ControlHandle -WinHandle $winhandle -Control \"Edit1\"\n\n# Change the edit control\nSet-AU3ControlText -ControlHandle $controlHandle -NewText \"Hello! This is being controlled by AutoIt and PowerShell!\" -WinHandle $winHandle\n\n# Send some keystrokes to the edit control\nSend-AU3ControlKey -ControlHandle $controlHandle -Key \"{ENTER}simulate key strokes - line 1\" -WinHandle $winHandle\nSend-AU3ControlKey -ControlHandle $controlHandle -Key \"{ENTER}simulate key strokes - line 2\" -WinHandle $winHandle\nSend-AU3ControlKey -ControlHandle $controlHandle -Key \"{ENTER}{ENTER}\" -WinHandle $winHandle<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6A9955\"># Import the AutoIt PowerShell module<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Import-Module<\/span><span style=\"color: #D4D4D4\"> .\\AutoItX.psd1<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\"># Run notepad.exe<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Invoke-AU3Run<\/span><span style=\"color: #D4D4D4\"> -Program <\/span><span style=\"color: #DCDCAA\">notepad.exe<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\"># Wait for an untitled notepad window and get the handle<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$notepadTitle<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">&quot;Untitled - Notepad&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Wait-AU3Win<\/span><span style=\"color: #D4D4D4\"> -Title <\/span><span style=\"color: #9CDCFE\">$notepadTitle<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$winHandle<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #DCDCAA\">Get-AU3WinHandle<\/span><span style=\"color: #D4D4D4\"> -Title <\/span><span style=\"color: #9CDCFE\">$notepadTitle<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\"># Activate the window<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Show-AU3WinActivate<\/span><span style=\"color: #D4D4D4\"> -WinHandle <\/span><span style=\"color: #9CDCFE\">$winHandle<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\"># Get the handle of the notepad text control for reliable operations<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$controlHandle<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #DCDCAA\">Get-AU3ControlHandle<\/span><span style=\"color: #D4D4D4\"> -WinHandle <\/span><span style=\"color: #9CDCFE\">$winhandle<\/span><span style=\"color: #D4D4D4\"> -Control <\/span><span style=\"color: #CE9178\">&quot;Edit1&quot;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\"># Change the edit control<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Set-AU3ControlText<\/span><span style=\"color: #D4D4D4\"> -ControlHandle <\/span><span style=\"color: #9CDCFE\">$controlHandle<\/span><span style=\"color: #D4D4D4\"> -NewText <\/span><span style=\"color: #CE9178\">&quot;Hello! This is being controlled by AutoIt and PowerShell!&quot;<\/span><span style=\"color: #D4D4D4\"> -WinHandle <\/span><span style=\"color: #9CDCFE\">$winHandle<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\"># Send some keystrokes to the edit control<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Send-AU3ControlKey<\/span><span style=\"color: #D4D4D4\"> -ControlHandle <\/span><span style=\"color: #9CDCFE\">$controlHandle<\/span><span style=\"color: #D4D4D4\"> -Key <\/span><span style=\"color: #CE9178\">&quot;{ENTER}simulate key strokes - line 1&quot;<\/span><span style=\"color: #D4D4D4\"> -WinHandle <\/span><span style=\"color: #9CDCFE\">$winHandle<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Send-AU3ControlKey<\/span><span style=\"color: #D4D4D4\"> -ControlHandle <\/span><span style=\"color: #9CDCFE\">$controlHandle<\/span><span style=\"color: #D4D4D4\"> -Key <\/span><span style=\"color: #CE9178\">&quot;{ENTER}simulate key strokes - line 2&quot;<\/span><span style=\"color: #D4D4D4\"> -WinHandle <\/span><span style=\"color: #9CDCFE\">$winHandle<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Send-AU3ControlKey<\/span><span style=\"color: #D4D4D4\"> -ControlHandle <\/span><span style=\"color: #9CDCFE\">$controlHandle<\/span><span style=\"color: #D4D4D4\"> -Key <\/span><span style=\"color: #CE9178\">&quot;{ENTER}{ENTER}&quot;<\/span><span style=\"color: #D4D4D4\"> -WinHandle <\/span><span style=\"color: #9CDCFE\">$winHandle<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>This is how the notepad window should look if everything is working correctly:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"513\" height=\"171\" src=\"https:\/\/www.autoitconsulting.com\/site\/wp-content\/uploads\/2015\/07\/notepad_powershell.png\" alt=\"notepad_powershell\" class=\"wp-image-1436\" srcset=\"https:\/\/www.autoitconsulting.com\/site\/wp-content\/uploads\/2015\/07\/notepad_powershell.png 513w, https:\/\/www.autoitconsulting.com\/site\/wp-content\/uploads\/2015\/07\/notepad_powershell-300x100.png 300w, https:\/\/www.autoitconsulting.com\/site\/wp-content\/uploads\/2015\/07\/notepad_powershell-510x171.png 510w\" sizes=\"auto, (max-width: 513px) 100vw, 513px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Overview The newest versions of the AutoIt scripting language now come with a bonus for PowerShell users. A set of native PowerShell Cmdlets! This allows you to add the unique features of AutoIt &#8211; window manipulation and keystroke simulation &#8211; to your usual PowerShell scripts. As an additional bonus, the AutoIt PowerShell Cmdlets and Assemblies [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1427,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[48,54,65],"class_list":["post-1426","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-autoit","tag-powershell","tag-scripting"],"_links":{"self":[{"href":"https:\/\/www.autoitconsulting.com\/site\/wp-json\/wp\/v2\/posts\/1426","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.autoitconsulting.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.autoitconsulting.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.autoitconsulting.com\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.autoitconsulting.com\/site\/wp-json\/wp\/v2\/comments?post=1426"}],"version-history":[{"count":12,"href":"https:\/\/www.autoitconsulting.com\/site\/wp-json\/wp\/v2\/posts\/1426\/revisions"}],"predecessor-version":[{"id":100135,"href":"https:\/\/www.autoitconsulting.com\/site\/wp-json\/wp\/v2\/posts\/1426\/revisions\/100135"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.autoitconsulting.com\/site\/wp-json\/wp\/v2\/media\/1427"}],"wp:attachment":[{"href":"https:\/\/www.autoitconsulting.com\/site\/wp-json\/wp\/v2\/media?parent=1426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.autoitconsulting.com\/site\/wp-json\/wp\/v2\/categories?post=1426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.autoitconsulting.com\/site\/wp-json\/wp\/v2\/tags?post=1426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}