ユーザ用ツール

サイト用ツール


programming:powershell

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

次のリビジョン
前のリビジョン
programming:powershell [2014/02/07 06:02] – 作成 dotprogramming:powershell [2015/06/17 05:20] (現在) – 外部編集 127.0.0.1
行 7: 行 7:
 powershell -Command  "Set-ExecutionPolicy Unrestricted" powershell -Command  "Set-ExecutionPolicy Unrestricted"
 </code> </code>
 +
 +ポリシーの種類
 +
 +  * Restricted - 実行できるスクリプトはありません。Windows PowerShell は対話型モードでのみ使用できます。
 +  * AllSigned - 信頼できる発行元が署名したスクリプトのみを実行できます。
 +  * RemoteSigned - ダウンロードしたスクリプトは信頼できる発行元が署名した場合にのみ実行できます。
 +  * Unrestricted - 制限なし。すべての Windows PowerShell スクリプトを実行できます。
 +
 +====== HTTPダウンローダー(wget相当) ======
 +
 +url.txtを読み込んで各行のURLで示されたファイルをダウンロードする。
 +
 +<file powershell wget-list.ps1>
 +$webClient = New-Object System.Net.WebClient 
 +
 +$Urls = Get-Content url.txt
 +
 +for ( $i = 1; $i -le $Urls.Length; $i++ ){
 +  $webClient.DownloadFile($Urls[$i - 1], ($Urls[$i - 1]).Substring(($Urls[$i - 1]).LastIndexOf("/") + 1))
 +}
 +</file>
 +
 +<file text url.txt>
 +http://www.jitec.ipa.go.jp/1_04hanni_sukiru/mondai_kaitou_2004h16_2/2004h16a_ad_am_ans.pdf
 +http://www.jitec.ipa.go.jp/1_04hanni_sukiru/mondai_kaitou_2004h16_2/2004h16a_ad_pm_ans.pdf
 +http://www.jitec.ipa.go.jp/1_04hanni_sukiru/mondai_kaitou_2004h16_2/2004h16a_fe_am_ans.pdf
 +http://www.jitec.ipa.go.jp/1_04hanni_sukiru/mondai_kaitou_2004h16_2/2004h16a_fe_pm_ans.pdf
 +</file>
programming/powershell.1391752963.txt.gz · 最終更新: 2015/06/17 05:08 (外部編集)