{"id":4946,"date":"2014-10-16T16:28:56","date_gmt":"2014-10-16T07:28:56","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=4946"},"modified":"2014-10-16T16:28:56","modified_gmt":"2014-10-16T07:28:56","slug":"ui-automation-powershell-extensions%e3%82%92%e8%a9%a6%e3%81%97%e3%81%ab%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%be%e3%81%97%e3%81%9f%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=4946","title":{"rendered":"UI Automation PowerShell Extensions\u3092\u8a66\u3057\u306b\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f\u3002"},"content":{"rendered":"<p>\u300c<a href=\"http:\/\/d.sunnyone.org\/2014\/09\/windowsuiui-automation-powershell.html\" title=\"d.sunnyone.org: Windows\u30a2\u30d7\u30ea\u306eUI\u81ea\u52d5\u64cd\u4f5c\u3092UI Automation PowerShell Extension\u3067\u884c\u3046\" target=\"_blank\">d.sunnyone.org: Windows\u30a2\u30d7\u30ea\u306eUI\u81ea\u52d5\u64cd\u4f5c\u3092UI Automation PowerShell Extension\u3067\u884c\u3046<\/a>\u300d\u306e\u8a18\u4e8b\u3092\u8aad\u3093\u3067\u3001<a href=\"http:\/\/msdn.microsoft.com\/ja-jp\/library\/ms753107.aspx\" title=\"UI \u30aa\u30fc\u30c8\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u57fa\u790e\" target=\"_blank\">UI Automation<\/a>\u306ePowerShell\u7528\u30e9\u30c3\u30d1\u30fc\u304c\u3042\u308b\u3053\u3068\u3092\u77e5\u3063\u305f\u306e\u3067\u3001\u65e9\u901f\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><strong>\u30fbUI Automation PowerShell Extensions &#8211; Home<\/strong><br \/>\n<a href=\"http:\/\/uiautomation.codeplex.com\/\" title=\"UI Automation PowerShell Extensions - Home\" target=\"_blank\">http:\/\/uiautomation.codeplex.com\/<\/a><\/p>\n<h4>\u25a0 \u4f7f\u7528\u6e96\u5099<\/h4>\n<ol>\n<li>\u4e0a\u8a18\u30da\u30fc\u30b8\u304b\u3089Zip\u30d5\u30a1\u30a4\u30eb(2014\/10\/16 \u6642\u70b9\u3067\u306fUIAutomation.0.8.7B3.NET35.zip)\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u9069\u5f53\u306a\u30d5\u30a9\u30eb\u30c0(\u3053\u3053\u3067\u306f<span style=\"color: #ff0000; font-weight: bold;\">C:\\System\\UIAutomation<\/span>)\u306b\u5c55\u958b\u3057\u307e\u3059\u3002<\/li>\n<li>\u7ba1\u7406\u8005\u6a29\u9650\u3067PowerShell\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002UI Automation PowerShell Extensions\u3092\u5229\u7528\u3059\u308b\u306b\u306fPowerShell 2.0\u4ee5\u4e0a\u304c\u5fc5\u8981\u306b\u306a\u308b\u306e\u3067\u3001\u300c<a href=\"http:\/\/win.just4fun.biz\/PowerShell\/Windows7%E3%81%ABPowerShell3.0%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86.html\" title=\"PowerShell\/Windows7\u306bPowerShell3.0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u624b\u9806 - Windows\u3068\u66ae\u3089\u3059\" target=\"_blank\">Windows7\u306bPowerShell3.0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u624b\u9806<\/a>\u300d\u7b49\u3092\u53c2\u8003\u306b\u3001\u4e8b\u524d\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/li>\n<li>\u300c<span style=\"color: #ff0000; font-weight: bold;\">Set-ExecutionPolicy Bypass<\/span>\u300d\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/li>\n<li>\u4e00\u6642\u7684\u306b\u8a66\u7528\u3059\u308b\u3060\u3051\u306a\u306e\u3067\u3001\u300c<span style=\"color: #ff0000; font-weight: bold;\">ipmo C:\\System\\UIAutomation\\UIAutomation.dll<\/span>\u300d\u3092\u5b9f\u884c\u3057\u3066\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/li>\n<li>\u300c<span style=\"color: #ff0000; font-weight: bold;\">(gmo uia*).Name<\/span>\u300d\u3092\u5b9f\u884c\u3057\u3066\u3001\u300c<span style=\"color: #ff0000; font-weight: bold;\">UIAutomation<\/span>\u300d\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u6e96\u5099\u5b8c\u4e86\u3067\u3059\u3002<\/li>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/UIAutomationPowerShellExtensions_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/UIAutomationPowerShellExtensions_01.jpg\" alt=\"UIAutomationPowerShellExtensions_01\" width=\"997\" height=\"502\" class=\"alignnone size-full wp-image-4947\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/UIAutomationPowerShellExtensions_01.jpg 997w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/UIAutomationPowerShellExtensions_01-300x151.jpg 300w\" sizes=\"auto, (max-width: 997px) 100vw, 997px\" \/><\/a>\n<\/ol>\n<h4>\u25a0 UI Automation PowerShell Extensions\u3092\u4f7f\u3063\u3066\u96fb\u5353\u64cd\u4f5c<\/h4>\n<p>UI Automation PowerShell Extensions\u4ed8\u5c5e\u306e<span style=\"color: #ff0000; font-weight: bold;\">UIAutomationSpy.exe<\/span>\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">Get-UiaWindow -Class 'CalcFrame' -Name '\u96fb\u5353' | `\r\nGet-UiaPane -Class 'CalcFrame' | `\r\nGet-UiaPane -Class '#32770' | `\r\nGet-UiaButton -AutomationId '131' -Class 'Button' -Name '1'<\/pre>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/UIAutomationPowerShellExtensions_02.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/UIAutomationPowerShellExtensions_02.jpg\" alt=\"UIAutomationPowerShellExtensions_02\" width=\"732\" height=\"368\" class=\"alignnone size-full wp-image-4948\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/UIAutomationPowerShellExtensions_02.jpg 732w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/UIAutomationPowerShellExtensions_02-300x150.jpg 300w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/a><\/p>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3068<a href=\"http:\/\/uiautomation.codeplex.com\/wikipage?title=Invoking%20actions%20on%20controls\" title=\"UI Automation PowerShell Extensions - Documentation\" target=\"_blank\">\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/a>\u3092\u53c2\u8003\u306b\u3001<span style=\"color: #ff0000; font-weight: bold;\">\u201c\u96fb\u5353\u3092\u8d77\u52d5\u3057\u3066\u300c1\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u201d<\/span>\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3068\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">$calc = Start-Process calc -PassThru | Get-UIAWindow\r\n$btn = $calc | Get-UiaButton -Class 'Button' -Name '1'\r\n$btn | Invoke-UiaButtonClick<\/pre>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/UIAutomationPowerShellExtensions_03.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/UIAutomationPowerShellExtensions_03.jpg\" alt=\"UIAutomationPowerShellExtensions_03\" width=\"708\" height=\"632\" class=\"alignnone size-full wp-image-4949\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/UIAutomationPowerShellExtensions_03.jpg 708w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/UIAutomationPowerShellExtensions_03-300x267.jpg 300w\" sizes=\"auto, (max-width: 708px) 100vw, 708px\" \/><\/a><\/p>\n<p>\u4e0a\u8a18\u306e\u901a\u308a\u3001\u975e\u5e38\u306b\u77ed\u3044\u30b3\u30fc\u30c9\u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u64cd\u4f5c\u3067\u304d\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<br \/>\n\u300c<a href=\"http:\/\/uiautomation.codeplex.com\/wikipage?title=the%20Control%20property\" title=\"UI Automation PowerShell Extensions - Documentation\" target=\"_blank\">UI Automation PowerShell Extensions &#8211; Documentation<\/a>\u300d\u3092\u898b\u308b\u9650\u308a\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306e\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3084\u53f3\u30af\u30ea\u30c3\u30af\u3082\u7c21\u5358\u306b\u3067\u304d\u308b\u307f\u305f\u3044\u3067\u3059\u3002<\/p>\n<p>\u4f5c\u6210\u3057\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u30c6\u30b9\u30c8\u3059\u308b\u3068\u304d\u306b\u306f\u304b\u306a\u308a\u5f79\u7acb\u3061\u305d\u3046\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3059\u306d\uff01<br \/>\n\u77e5\u3063\u3066\u304a\u3044\u3066\u640d\u306f\u7121\u3044\u3060\u308d\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u300cd.sunnyone.org: Windows\u30a2\u30d7\u30ea\u306eUI\u81ea\u52d5\u64cd\u4f5c\u3092UI Automation PowerShell Extension\u3067\u884c\u3046\u300d\u306e\u8a18\u4e8b\u3092\u8aad\u3093\u3067\u3001UI Automation\u306ePowerShell\u7528\u30e9\u30c3\u30d1\u30fc [&hellip;]","protected":false},"author":1,"featured_media":7127,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c6\u30b9\u30c8\u3084\u81ea\u52d5\u5316\u3092\u884c\u3046\u969b\u306b\u5f79\u7acb\u3061\u305d\u3046\u3067\u3059\u3002 [UI Automation PowerShell Extensions\u3092\u8a66\u3057\u306b\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f\u3002]","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[94],"tags":[],"class_list":["post-4946","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-PowerShell.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-1hM","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4946","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4946"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4946\/revisions"}],"predecessor-version":[{"id":4950,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4946\/revisions\/4950"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7127"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}