batの管理者権限自動再実行
:: 管理者権限チェック
net session >nul 2>&1
if %errorlevel% neq 0 (
echo 管理者権限で再実行します...
powershell -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
batで同じファイル名のPowerShellの実行
hoge.bat
hoge.ps1
@echo off
powershell -ExecutionPolicy RemoteSigned -File "%~dp0%~n0.ps1"
pause
Power Automate における改行の扱い方
| 表現 | 文字コード | UriComponent | Power Automateでの扱い方 |
|---|---|---|---|
| CR | 0x0d | %0D | decodeUriComponent('%0D') |
| LF | 0x0a | %0A | decodeUriComponent('%0A') |
Formsで取得した改行を含む文章をメール送信しても改行はFormsの入力通り反映されないため、改行コードを<br>に置き換える必要があるが\nを置換すればいいわけではない。
例
replace(replace(text,decodeUriComponent('%0D'),'<br>'),decodeUriComponent('%0A'),'<br>')