From 7c2acb0b1d30cdd0635162a5e055877c82efd258 Mon Sep 17 00:00:00 2001 From: Alex <116945542+Lifailon@users.noreply.github.com> Date: Fri, 17 Feb 2023 18:50:01 +0300 Subject: [PATCH] Update README.md --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c63d0b9..c2d1c7c 100644 --- a/README.md +++ b/README.md @@ -519,9 +519,18 @@ ### Out-Gridview `Get-Service -cn $srv | Out-GridView -Title "Service $srv" -OutputMode Single –PassThru | Restart-Service` перезапустить выбранную службу -### wshell +### ComObject `$wshell = New-Object -ComObject Wscript.Shell` \ -`$Output = $wshell.Popup("Выберите действие?",0,"Заголовок",4)` \ +`$wshell | Get-Member` \ +`$link = $wshell.CreateShortcut("$Home\Desktop\Яндекс.lnk")` создать ярлык \ +`$link.TargetPath = "https://yandex.ru"` куда ссылается (метод TargetPath объекта $link где хранится дочерний объект CreateShortcut) \ +`$link.Save()` сохранить \ +`$wshell.Exec("notepad.exe")` запустить приложение \ +`$wshell.AppActivate('Блокнот')` открыть запущенное приложение \ +`$wshell.SendKeys("HI")` + +`$wshell = New-Object -ComObject Wscript.Shell` \ +`$output = $wshell.Popup("Выберите действие?",0,"Заголовок",4)` \ `if ($output -eq 6) {"yes"} elseif ($output -eq 7) {"no"} else {"no good"}` `Type:` \