Skip to content

Instantly share code, notes, and snippets.

@stknohg
Created April 7, 2017 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stknohg/6131fda472863c2afa5eb02ba2057f8c to your computer and use it in GitHub Desktop.
Save stknohg/6131fda472863c2afa5eb02ba2057f8c to your computer and use it in GitHub Desktop.
Bash on Ubuntu on WindowsからWindows側のPowerShellを呼ぶ雑な例
#
# 良い例が思いつかなかったのでとりあえずgrepしてみる
#
# -Commandパラメータはスクリプトブロックとしては認識されず、文字列として指定する必要があるっぽい。
#
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command '&{ Get-NetFirewallRule }' | grep Name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment