【1:39】PowerShell ver.1- 1 名前:まにえ:09/06/11 11:59 ID:GkyQ++wQ
- ちょっといじってみるスレ。
- 29 名前:manie:09/06/12 14:48 ID:nfYn4NpA
- --押して離す.ps1 実行結果
0 1 2 3 4 5 6 7 8 9 A B C D E F 0□□□□□□□□□□□□□□□□ 1□□□□□□□□□□□■□□□□ 2□□□□□□□■■□□□□□□□ 3□□□□□□□□□□□□□□□□ 4□■□□□□□□□□□□□□□□ 5□□□□□□□□□□□□□□□□ 6□□□□□□□□□□□□□□□□ 7□□□□□□□□□□□□□□□□ 8□□□□□□□□□□□□□□□□ 9□□□□□□□□□□□□□□□□ A□□□□□□□□□□□□□□□□ B□□□□□□□□□□□□□□□□ C□□□□□□□□□□□□□□□□ D□□□□□□□□□□□□□□□□ E□□□□□□□□□□□□□□□□ F□□□□□□□□□□□□□□□□ ESCキーを押すと終了します。 --
- 30 名前:manie:09/06/12 14:49 ID:nfYn4NpA
- powershellってフォントとか桁数とか指定できるのだろうか。
- 31 名前:ラキッ!@x68ch ★:09/06/13 00:57 ID:???
- tcsh に移植できるだろうか。
- 32 名前:manie:09/06/13 16:44 ID:tspAUbZo
- 音を出す方法を勉強した。
--wavplay.ps1 $w = New-Object System.Media.SoundPlayer("$env:SystemRoot\Media\tada.wav") $w.Play() -- 実行結果は特に無いので割愛。
- 33 名前:manie:09/06/13 21:38 ID:tspAUbZo
- 実行しているスクリプトのパスを得る方法を勉強した。
--実行パス.ps1 Write-Host "スクリプトのフルパス" $MyInvocation.MyCommand.Path Write-Host "スクリプト名のみ" $MyInvocation.MyCommand.Name Write-Host "スクリプトのあるフォルダ" (Split-Path $MyInvocation.MyCommand.Path -parent) --
--実行パス.ps1 実行結果 PS C:\powershell> .\実行パス.ps1 スクリプトのフルパス C:\powershell\実行パス.ps1 スクリプト名のみ 実行パス.ps1 スクリプトのあるフォルダ C:\powershell --
.NET Frameworkの実行パスを取得すると、 powershell自身の実行パスを取得してしまうのではまったぜ。
- 34 名前:manie:09/06/14 00:19 ID:ItAx1R1w
- httpダウンロードをする方法を勉強した。
配布するスクリプトを小さくする場合に有効かもしれない。
--http.ps1 $c = New-Object System.Net.WebClient $l = (Split-path $MyInvocation.MyCommand.Path -parent)
$u = "http://osabisi.sakura.ne.jp/m2/tm4/se/" $f = "tm2r_coin06.wav", "tm2r_close12_r.wav", "tm2r_crash25r.wav", "tm2r_crash28.wav", "tm2r_crash28r.wav", "tm2r_kara00_r.wav", "tm2r_bom26_c.wav", "tm2r_bom27_a.wav", "tm2r_bom31_b.wav", "tm2r_bom34.wav", "tm2r_gun18_d.wav", "tm2r_mecha31.wav", "tm2r_shoot15.wav", "tm2r_shoot16.wav"
foreach( $file in $f ) { $ufile = $u + $file $url = New-Object System.Uri($ufile) $lfile = Join-Path $l $file $c.DownloadFile($url,$lfile) } --
マッチメイカァズのサイトからwavファイルをダウンロードします。
- 35 名前:manie:09/06/14 05:13 ID:ItAx1R1w
- 外部コマンドの実行と実行結果の取得。
--外部コマンド.ps1 (Invoke-Expression "c:\d.bat c:\powershell") | out-file -FilePath ".\dir.txt" -Encoding utf8 --
--c:\d.bat dir %1 --
- 36 名前:manie:09/06/14 05:14 ID:ItAx1R1w
- --c:\powershell\dir.txt リダイレクトファイル
C:\powershell>dir c:\powershell ドライブ C のボリューム ラベルがありません。 ボリューム シリアル番号は B8DF-C119 です
c:\powershell のディレクトリ
2009/06/14 05:05 <DIR> . 2009/06/14 05:05 <DIR> .. 2009/06/14 00:42 1,412 dir.txt 2009/06/13 23:58 600 http.ps1 2009/06/13 23:58 226,556 tm2r_bom26_c.wav 2009/06/13 23:58 134,960 tm2r_bom27_a.wav 2009/06/13 23:58 243,168 tm2r_bom31_b.wav 2009/06/13 23:58 81,964 tm2r_bom34.wav 2009/06/13 23:58 89,756 tm2r_close12_r.wav 2009/06/13 23:58 111,148 tm2r_coin06.wav 2009/06/13 23:58 82,694 tm2r_crash25r.wav 2009/06/13 23:58 87,690 tm2r_crash28.wav 2009/06/13 23:58 81,674 tm2r_crash28r.wav 2009/06/13 23:58 50,156 tm2r_gun18_d.wav 2009/06/13 23:58 133,676 tm2r_kara00_r.wav 2009/06/13 23:58 82,322 tm2r_mecha31.wav 2009/06/13 23:58 33,654 tm2r_shoot15.wav 2009/06/13 23:58 31,796 tm2r_shoot16.wav 2009/06/13 16:41 87 wavplay.ps1 2009/06/11 12:46 27 はろー.ps1 2009/06/11 15:47 274 キー入力.ps1 2009/06/11 17:26 663 リアルタイム入力.ps1 2009/06/11 15:31 261 変数.ps1 2009/06/11 15:40 261 変数2.ps1 2009/06/14 05:06 92 外部コマンド.ps1 2009/06/13 21:33 213 実行パス.ps1 2009/06/13 05:18 1,041 押して離す.ps1 2009/06/11 17:06 500 時間制限.ps1 (省略されました・・全てを読むにはこちらを押してください)
- 37 名前:manie:09/06/24 19:56 ID:3EQnnWeE
- カーソル位置を(0,0)に移動するよりも、clsした方が10倍以上速い。あとは、わかるな?
- 38 名前:米屋@x68ch ★:09/07/16 18:35 ID:???
- >>8
いまさらですがすんまそん 「はろー」で始まる英文カキコが多かったもので。。。
|