Power Automate Desktop¤ÏWindows¤Î¥½¥Õ¥È¤Îµ¯Æ°¡¢¥á¥Ë¥å¡¼Áàºî¡¢¥Æ¥¥¹¥È¥Ü¥Ã¥¯¥¹¤Ø¤ÎÆþÎϤʤɤò½ç¤Ë¼«Æ°¤Ç¹Ô¤¦¥·¡¼¥±¥ó¥µ¡¼¤ß¤¿¤¤¤Ê¤â¤Î¡£
´û¤ËÆþ¤Ã¤Æ¤¤¤ë¤Î¤Ç¡¢power automate¤Ç¥¢¥×¥ê¤ò¸¡º÷¤¹¤ë
°Ê²¼¤«¤éPower Automate ¥¤¥ó¥¹¥È¡¼¥é¡¼¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¡£
µ¯Æ°¤¹¤ë¤ÈMS¥¢¥«¥¦¥ó¥È¤Ç¥í¥°¥¤¥ó¤òµá¤á¤é¤ì¤ë¤Î¤Ç¡¢¥í¥°¥¤¥ó¤¹¤ë¡£
µ¯Æ°¤¹¤ë¤È°Ê²¼¤Î¤è¤¦¤Ê²èÌ̤ˤˤʤë
¼«Ê¬¤Î¥Õ¥í¡¼¤Ë°ÜÆ°¤·¤Æ¡¢¡Ö¿·¤·¤¤¥Õ¥í¡¼¡×¤òÁªÂò¤¹¤ë¡£
¥Õ¥í¡¼¤òºîÀ®¤¹¤ë²èÌ̤ǡ¢¥Õ¥í¡¼Ì¾¤òÆþÎϤ·¤ÆºîÀ®¥Ü¥¿¥ó¤ò²¡¤¹¡£
°Ê²¼¤ÎºîÀ®²èÌ̤¬³«¤¯
&ref(): File not found: "µ¯Æ°4.png" at page "Windows_Router Memo/Power Automate Desktop";
º¸¥Ú¥¤¥ó¤Î¥¢¥¯¥·¥ç¥ó¤«¤éÃæ±û¤Î¥Ú¥¤¥ó¤ÎMain¤Î¥Ú¥¤¥ó¤Ë¥É¥é¥Ã¥¯¤·¤Æʤ٤Ƥ¤¤¯
°Ê²¼¤Î¼ê½ç¤Ç¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òµ¯Æ°¤µ¤»¡¢µ¯Æ°²èÌ̤òɽ¼¨¤µ¤»¤ë¡£
&ref(): File not found: "¥³¥ó¥½¡¼¥ë½ªÎ».png" at page "Windows_Router Memo/Power Automate Desktop";
# Power Automate for desktop¤Î¥Õ¥í¡¼¤ò¼Â¹Ô¤¹¤ëPowerShell¥¹¥¯¥ê¥×¥È # @param [string] $flowName ¼Â¹Ô¤¹¤ë¥Õ¥í¡¼Ì¾ # @param [bool] $flgExit PAD½ªÎ»¥Õ¥é¥° # # Æ°ºî³Îǧ¡§¥Ð¡¼¥¸¥ç¥ó 2.40.157.24023 (¥¤¥ó¥¹¥È¡¼¥é¡¼ÈÇ) # Param( [bool]$flgExit = $false ) #Power Automate for desktopµ¯Æ° Start-Process -FilePath "ms-powerautomate://" #UI Automation Add-Type -AssemblyName "UIAutomationClient" Add-Type -AssemblyName "UIAutomationTypes" $uiAuto = [System.Windows.Automation.AutomationElement] $pcdn = [System.Windows.Automation.PropertyCondition] $acdn = [System.Windows.Automation.AndCondition] $tree = [System.Windows.Automation.TreeScope] $iptn = [System.Windows.Automation.InvokePattern]::Pattern $wptn = [System.Windows.Automation.WindowPattern]::Pattern $icptn = [System.Windows.Automation.ItemContainerPattern]::Pattern $siptn = [System.Windows.Automation.ScrollItemPattern]::Pattern $selptn = [System.Windows.Automation.SelectionItemPattern]::Pattern $root = $uiAuto::RootElement #Power Automate for desktop¥¦¥£¥ó¥É¥¦¼èÆÀ $cndPadWindowId = New-Object $pcdn($uiAuto::AutomationIdProperty, "ConsoleMainWindow") $cndPadWindowClassName = New-Object $pcdn($uiAuto::ClassNameProperty, "WinAutomationWindow") $cndPadWindow = New-Object $acdn($cndPadWindowId, $cndPadWindowClassName) do{ Start-Sleep -m 200 $elmPadWindow = $root.FindFirst($tree::Children, $cndPadWindow) }while($elmPadWindow -eq $null) #¥¿¥Ö¼èÆÀ $cndTab = New-Object $pcdn($uiAuto::AutomationIdProperty, "ProcessesTabControl") $elmTab = $elmPadWindow.FindFirst($tree::Subtree, $cndTab) #¥¿¥Ö¹àÌܼèÆÀ¡¦ÁªÂò if($elmTab -ne $null){ $cndTabItem = New-Object $pcdn($uiAuto::AutomationIdProperty, "MyFlowsTab") $elmTabItem = $elmTab.FindFirst($tree::Children, $cndTabItem) if($elmTabItem -ne $null){ $selTabItem = $elmTabItem.GetCurrentPattern($selptn) $selTabItem.Select() } } #¥Ç¡¼¥¿¥°¥ê¥Ã¥É¼èÆÀ if($elmPadWindow -ne $null){ $cndDataGrid = New-Object $pcdn($uiAuto::AutomationIdProperty, "MyFlowsListGrid") $elmDataGrid = $elmPadWindow.FindFirst($tree::Subtree, $cndDataGrid) } #¥Ç¡¼¥¿¹àÌܼèÆÀ¡¦ÁªÂò if($elmDataGrid -ne $null){ $icDataGrid = $elmDataGrid.GetCurrentPattern($icptn) $elmDataItem = $icDataGrid.FindItemByProperty($null, $uiAuto::NameProperty, "KpacsStart") #¢«¤³¤³¤Ë̾Á°¤òÆþ¤ì¤ë¡£¤¿¤À¤·É¬¤ºÈ¾³Ñ if($elmDataItem -ne $null){ $siDataItem = $elmDataItem.GetCurrentPattern($siptn) $siDataItem.ScrollIntoView() $selDataItem = $elmDataItem.GetCurrentPattern($selptn) $selDataItem.Select() } } #¼Â¹Ô¥Ü¥¿¥ó¼èÆÀ¡¦²¡²¼ if($elmDataItem -ne $null){ $cndStartButton = New-Object $pcdn($uiAuto::AutomationIdProperty, "StartFlowButton") $elmStartButton = $elmDataItem.FindFirst($tree::Subtree, $cndStartButton) if($elmStartButton -ne $null){ $ivkStartButton = $elmStartButton.GetCurrentPattern($iptn) $ivkStartButton.Invoke() } } if($flgExit){ #¥Õ¥í¡¼½ªÎ»ÂÔ¤Á if($elmStartButton -ne $null){ do{ Start-Sleep -m 800 }while($elmStartButton.GetCurrentPropertyValue($uiAuto::IsEnabledProperty) -eq $false) } #Power Automate for desktop½ªÎ» $winPadWindow = $elmPadWindow.GetCurrentPattern($wptn) $winPadWindow.Close() }
¤µ¤é¤Ë¡¢°Ê²¼¤Î¤è¤¦¤Ê¥Ð¥Ã¥Á¤òºîÀ®¤·¤Æ¤½¤Î¥·¥ç¡¼¥È¥«¥Ã¥È¤òºîÀ®¤¹¤ë
powershell -ExecutionPolicy Bypass -File "kidou.ps1"