範囲演算子(PowerShell 入門)

by HIRO 20. 8月 2008 23:27

この記事は以前 http://blog.hiros-dot.net/ に書いたものです。

PowerShellには「範囲演算子」と呼ばれる演算子があります。

範囲演算子とは2つのピリオド(..)で表し

範囲の開始値..範囲の終了値

のように記述します。

1..5

記述した場合は1から5までという意味になります。

下記は1から5まで繰り返し、その値を表示します。

PS > foreach ( $cnt in 1..5 )
>> {
>> Write-Host $cnt
>> }
>>
1
2
3
4
5

 

最新のブログ

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

PowerShell | PowerShell入門

コメント

コメントを書く


 

  Country flag

biuquoteredbluegreenyellowPowerShellTextFile
  • コメント
  • プレビュー
Loading



Calendar

<<  3月 2010  >>
月曜火曜水曜木曜金曜土曜日曜
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010 PowerShell from Japan!!