{"id":939,"date":"2021-12-30T14:28:38","date_gmt":"2021-12-30T05:28:38","guid":{"rendered":"https:\/\/beiyan-tool.info\/?p=939"},"modified":"2021-12-30T14:28:38","modified_gmt":"2021-12-30T05:28:38","slug":"powershell%e3%82%b9%e3%82%af%e3%83%aa%e3%83%97%e3%83%88%e3%82%92%e6%b0%97%e8%bb%bd%e3%81%ab%e5%ae%9f%e8%a1%8c%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/beiyan-tool.info\/?p=939","title":{"rendered":"PowerShell\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u6c17\u8efd\u306b\u5b9f\u884c\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u30d0\u30c3\u30c1\u30d5\u30a1\u30a4\u30eb\u3088\u308a\u3082VBScript\u3001VBScript\u3088\u308a\u3082PowerShell\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u65b9\u304c\u3044\u308d\u3044\u308d\u306a\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u4fbf\u5229\u3060\u3068\u308f\u304b\u3063\u3066\u3044\u3066\u3082\u3001PowerShell\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u8a2d\u5b9a\u3067\u306f\u3001\u30a8\u30af\u30b9\u30d7\u30ed\u30fc\u30e9\u4e0a\u3067.ps1\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u3053\u308d\u3067\u30c6\u30ad\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf\u3067\u958b\u304b\u308c\u308b\u3060\u3051\u3067\u5b9f\u884c\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u3053\u306e\u305b\u3044\u3067\u3001\u4eca\u307e\u3067PowerShell\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u304f\u306e\u3092\u305f\u3081\u3089\u3063\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>PowerShell\u3092\u8d77\u52d5\u3055\u305b\u3066\u3001Get-ExecutionPolicy\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u521d\u671f\u72b6\u614b\u3067\u306f\u3001Restricted\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u884c\u30dd\u30ea\u30b7\u30fc\u306b\u306f\u3001Restricted\u3001AllSigned\u3001RemoteSigned\u3001Unrestricted\u3001Bypass\u304c\u3042\u308a\u307e\u3059\u304c\u3001<br \/>\n\u62e1\u5f35\u5b50ps1\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3067\u5b9f\u884c\u3055\u305b\u308b\u305f\u3081\u306b\u306f\u3001RemoteSigned\u3001Unrestricted\u3001Bypass\u306e\u3069\u308c\u304b\u306b\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\nSet-ExecutionPolicy\u3068\u3044\u3046\u30b3\u30de\u30f3\u30c9\u3067\u5909\u66f4\u3067\u304d\u307e\u3059\u304c\u3001\u7ba1\u7406\u8005\u6a29\u9650\u304c\u5fc5\u8981\u3067\u3059\u3002<br \/>\n\u5b9f\u884c\u30dd\u30ea\u30b7\u30fc\u304cRestricted\u306e\u307e\u307e\u3067\u3001\u62e1\u5f35\u5b50ps1\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u7c21\u5358\u306b\u5b9f\u884c\u3059\u308b\u306b\u306f\u30d0\u30c3\u30c1\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u5185\u5bb9\u3067\u3001hello.ps1\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<div class=\"redbox\">Add-Type -Assembly System.Windows.Forms<br \/>\n[System.Windows.Forms.MessageBox]::Show(&#8220;Hello World!!&#8221;)<\/div>\n<p>\u540c\u3058\u30d5\u30a9\u30eb\u30c0\u306b\u4ee5\u4e0b\u306e\u5185\u5bb9\u3067hello.bat\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<div class=\"redbox\">powershell -NoProfile -ExecutionPolicy Unrestricted .\\hello.ps1<\/div>\n<p>hello.bat\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3059\u308c\u3070\u3001hello.ps1\u3092\u52d5\u4f5c\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001PowerShell\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u30d0\u30c3\u30c1\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308b\u3060\u3051\u3067\u826f\u3044\u306e\u3067\u7c21\u5358\u3067\u3059\u3002<\/p>\n<p>\u30bf\u30b9\u30af\u30b9\u30b1\u30b8\u30e5\u30fc\u30e9\u304b\u3089\u5b9f\u884c\u3059\u308b\u5834\u5408\u306f\u3001\u30d0\u30c3\u30c1\u30d5\u30a1\u30a4\u30eb\u306f\u4e0d\u8981\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u3053\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<div class=\"redbox\">\u30bf\u30b9\u30af\u306bpowershell.exe\u3001<br \/>\n\u300cC:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\u300d<br \/>\n\u5f15\u6570\u306b<br \/>\n\u300c-NoProfile -ExecutionPolicy Unrestricted C:\\Temp\\hello.ps1\u300d<\/div>\n<p>hello.ps1\u3092\u76f4\u63a5\u6307\u5b9a\u3057\u305f\u5834\u5408\u306f\u3001\u52d5\u4f5c\u3057\u307e\u305b\u3093\u3002<br \/>\npowershell.exe\u306b\u5f15\u6570\u3092\u3064\u3051\u3066\u30bf\u30b9\u30af\u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30d0\u30c3\u30c1\u30d5\u30a1\u30a4\u30eb\u3088\u308a\u3082VBScript\u3001VBScript\u3088\u308a\u3082PowerShell\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u65b9\u304c\u3044\u308d\u3044\u308d\u306a\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u4fbf\u5229\u3060\u3068\u308f\u304b\u3063\u3066\u3044\u3066\u3082\u3001PowerShell\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u8a2d\u5b9a\u3067\u306f\u3001 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-939","post","type-post","status-publish","format-standard","hentry","category-windows"],"_links":{"self":[{"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/posts\/939","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=939"}],"version-history":[{"count":1,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/posts\/939\/revisions"}],"predecessor-version":[{"id":940,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/posts\/939\/revisions\/940"}],"wp:attachment":[{"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}