2011-09-29 10 views
1

이 작동 :제어 창 위치는

(Get-Host).UI.RawUI 
$a = (Get-Host).UI.RawUI 
$a.BackgroundColor = "white" 
$a.ForegroundColor = "black" 

$size = (Get-Host).UI.RawUI.WindowSize 
$size.Width = 80 
$size.Height = 30 
(Get-Host).UI.RawUI.WindowSize = $size 

하지만이 작동하지 않습니다, 나는 그것이 작동되도록하는 방법을 잘 모르겠습니다 :

$position = (Get-Host).UI.RawUI.Windowposition 
$position.X = 0 
$position.Y = 30 
(Get-Host).UI.RawUI.Windowposition = $position 

내가 오류입니다 이상한. 그것은 뿌려 내가 외부 창 위치 설정하려고 할 때 "버퍼"

Exception setting "WindowPosition": "Cannot use the 
specified Window X (column) position because it extends 
past the width of the screen buffer. Specify another X 
position, starting with 0 as the left most column of 
the buffer. 

답변

4

오류가 정말 이상하지입니다 WindowPosition 때문에 Gets and sets the position, in characters, of the view window relative to the screen buffer.

그것은 윈도우의 위치를 ​​설정하지 않습니다,하지만 넣어 그것은 완고하게, 당신은 창문을 통해 볼 버퍼의 위치. 따라서 버퍼 외부에 있기 때문에 오류가 발생합니다.

http://msdn.microsoft.com/en-us/library/system.management.automation.host.pshostrawuserinterface.windowposition%28v=vs.85%29.aspx

불행하게도, 윈도우의 위치를 ​​설정하는 것은 간단하지 않다. 비록 그것을위한 스냅인이 있습니다 - http://wasp.codeplex.com/ (사용 Set-WindowPosition)

+0

네, 실제로 그렇게하고 있습니다. 좋아, 누가 그걸 필요로 할까? – djangofan