範囲演算子(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



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

© Copyright 2009 PowerShell from Japan!!