Get-Date -UFormat ''
IndexOutOfRangeException
$#$ ๋ฅผ throwํฉ๋๋ค. ์ค๋ฅ๊ฐ ๋ฌด์์ด ์๋ชป๋์๋์ง ๋งํ๊ณ UFormat ์ธ์์ ์ฃผ์๋ฅผ ๊ธฐ์ธ์ด๋ฉด ๋ ๋์์ด ๋ฉ๋๋ค. "๋๋ฝ๋๊ฑฐ๋ ์๋ชป๋ UFormat ๋ฌธ์์ด" ๋๋ ๊ทธ ํจ๊ณผ์ ๋ํ ๋จ์ด.
PS /test> get-date -uformat "$accidentallyEmptyFormatStringVariable"
get-date : Index was outside the bounds of the array.
At line:1 char:1
+ get-date -uformat ''
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-Date], IndexOutOfRangeException
+ FullyQualifiedErrorId : System.IndexOutOfRangeException,Microsoft.PowerShell.Commands.GetDateCommand
A message directing attention to the -UFormat string parameter being empty.
A message about some internal problem.
> $PSVersionTable
Name Value
---- -----
PSVersion 6.0.0-beta.8
PSEdition Core
GitCommitId v6.0.0-beta.8
OS Linux 2.6.32-042stab120.6 #1 SMP Thu Oct 27 16:59:03 MSK 2016
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
๋์ํฉ๋๋ค. ๋ชจ๋ ์ค๋ฅ ๋ฉ์์ง๋ ์ฌ์ฉ์๊ฐ ์กฐ์นํ ์ ์์ด์ผ ํฉ๋๋ค(๋๋ ๊ฐ๋ฅํ์ง ์์ ๊ฒฝ์ฐ ์ ๋ณด ์ ๊ณต).
์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ฒ ์ต๋๋ค.
@DdWr ์ก์์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ์ผ๋ฐ์ ์ผ๋ก ์ด๋ณด์๋ ๋๋ถ๋ถ์ ์คํ์ผ ์ฃผ์์ ๋ฐ์ต๋๋ค. ์ฝ๋ฉ ์ง์นจ ์ ์ฝ์ด๋ณด์ญ์์ค. ์ฃผ๋ก ์ฃผ๋ณ ์ฝ๋์ ์คํ์ผ์ ๋ฐ๋ผ์ผ ํฉ๋๋ค. ๋ํ ํ ์คํธ๋ฅผ ์ถ๊ฐํ์ญ์์ค(ShouldBeErrorId ํจ์ ์ฌ์ฉ). ์ ์ ํ Resx ํ์ผ์ ์ ์ค๋ฅ ๋ฉ์์ง๋ฅผ ๋ฃ์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ฒ ์ต๋๋ค.