Powershell 2.0이 Windows 7 상자의 C : \ Windows \ System32 \ WindowsPowerShell \ v1.0에 설치된 이유를 아는 사람이 있습니까?Powershell 2.0이 Powershell 1.0과 같은 위치에 설치된 이유는 무엇입니까?
답변
사실 그것은 부작용의 흥미로운 이야기입니다.
Visual Studio에는 "참조 추가"대화 상자에 고정 된 어셈블리 목록이 있습니다.
다른 모든 항목을 찾아야합니다. 개발자는 Windows 디렉터리에서이 위치를 찾습니다. System.Management.Automation.dll (대부분의 PowerShell이 실행되는 어셈블리) 이로 인해이 위치에 대한 절대 참조가 만들어졌습니다. PowerShell에는 side-by-side 설치 옵션이 없으므로 (.NET 프레임 워크와 마찬가지로) 경로를 사용하여 동일한 어셈블리를 계속 참조 할 수 있도록하는 것이 가장 좋습니다. 이전처럼 StrongName.
이 기사가 이렇게 남지 않았다면 PowerShell V1 위에 작성된 모든 응용 프로그램을 V2 용으로 다시 릴리스해야합니다.
PowerShell 2.0은 1.0과 매우 호환되므로 동일한 컴퓨터에 두 가지 버전이 필요하지 않다고 생각합니다. 그래서 그들은 XP와 Vista 시스템에서 1.0보다 2.0을 더 올려 놓았으며 Windows 7에서도 같은 디렉토리를 유지하기로 결정했을 것입니다. 이는 확장이 여전히 .ps1 (및 .psm1, .psd1)과 같은 이유이기도합니다.
Windows 7 x64에서도 같은 질문을 할 수 있습니다. 왜 System32라는 dir에 64 비트 시스템 dll이 있고 그런 64 비트 dll의 이름은 "32"로 끝나는가? user32.dll, kernel32.dll 등 :
"극한 호환성"은 없지만 이전 버전과의 호환성은 없습니다. – manojlds
저는 처음부터 Microsoft 팀이 Framework .NET 버전에서와 마찬가지로 PowerShell 버전을 나란히 배치 할 계획이라고 생각합니다. 그러나 당시에는 PowerShell을 단 한 번만 지원하기로 결정했습니다.
버전 1.0을 선택하기 위해 명령 줄의 -version 매개 변수를 사용할 때 더 이상한 점이 있습니다. $PSVersionTable
이 있고 값이 2.0 인 PSVersion이 있습니다. 당신이 두 버전
PowerShell에서의 V2.0 (VITH 버전 1.0 또는 2.0)
PS > $host
Name : ConsoleHost
Version : 2.0
InstanceId : b6ae2582-c1f4-422a-b057-16458b387f7d
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : fr-FR
CurrentUICulture : fr-FR
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
에 존재하는 VAR
$host
에 대한보고가있는 경우 $ PSVersionTable PowerShell을 1.0
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>powershell -version 1.0
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. Tous droits réservés.
PS C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC> cd \
PS C:\> $PSVersionTable
Name Value
---- -----
CLRVersion 2.0.50727.4952
BuildVersion 6.1.7600.16385
PSVersion 2.0
WSManStackVersion 2.0
PSCompatibleVersions {1.0, 2.0}
SerializationVersion 1.1.0.1
PSRemotingProtocolVersion 2.1
에 존재하지 않습니다
PowerShell V1.0
PS > $Host
Name : ConsoleHost
Version : 1.0.0.0
InstanceId : b55940f2-b3b2-4f99-b895-98aac4752369
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : fr-FR
CurrentUICulture : fr-FR
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
필자는 PowerShell V2.0이 거의 모든 PowerShell V1.0 스크립트를 실행할 수 있다고 생각합니다. Microsoft는 일부 vars를 추가합니다.이 vars가 스크립트에 있지만 땅콩이라면 문제가 발생할 수 있습니다.
일본
Windows 8에서는 여전히 C : \ Windows \ System32 \ WindowsPowerShell \ v1.0 \ powershell.exe이고 $ PSVersionTable은 PSVersion 3.0입니다. – benjguin
- 1. Powershell 내에서 Powershell 중첩을 감지하는 방법은 무엇입니까?
- 2. 기업에서 PowerShell 및 PowerShell 모듈을 사용하는 방법
- 3. 내 PowerShell 결과가 반복되는 이유는 무엇입니까?
- 4. PowerShell : PowerShell 대본 기록부 읽기
- 5. PowerShell 질문
- 6. PowerShell - 분산 형 솔루션
- 7. powershell 1.0의 osql은 무엇입니까?
- 8. PowerShell cmdlet이란 무엇입니까?
- 9. Powershell "join"
- 10. Powershell 스크립트에서 Medadata를 추출하는 PowerShell 스크립트
- 11. 스냅인 구축 PowerShell V1 및 PowerShell V2
- 12. PowerShell 스크립트를 통한 PowerShell 모듈 개발시기 선택
- 13. Powershell : 함수 보간
- 14. 다른 powershell 창에서 powershell 세션에 액세스하는 방법은 무엇입니까?
- 15. Powershell 조인
- 16. PowerShell ParameterBindingException
- 17. Powershell/GetEnumerator
- 18. PowerShell App.Config
- 19. Powershell 속성?
- 20. Powershell SQLCMD
- 21. Powershell impersonation
- 22. Powershell 출력
- 23. PowerShell Runspace와 DLR
- 24. Powershell 원격 명령
- 25. PowerShell 탭 완료 문제
- 26. powershell 스크립트의 오류
- 27. Powershell 상태 정보
- 28. 내부 논리가있는 Powershell 문제
- 29. Future of cmd & powershell
Windows 8의 Powershell v3 (미리보기)은 같은 장소에 있습니다. – manojlds