File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1161,15 +1161,14 @@ private static string GetHomeOrCreateTempHome()
11611161 return s_tempHome ;
11621162 }
11631163
1164- private readonly static Version PSVersion6 = new Version ( 6 , 0 ) ;
11651164 private static void GetStandardPlatformPaths (
11661165 PSCmdlet psCmdlet ,
11671166 out string localUserDir ,
11681167 out string allUsersDir )
11691168 {
11701169 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
11711170 {
1172- string powerShellType = ( psCmdlet . Host . Version >= PSVersion6 ) ? "PowerShell" : "WindowsPowerShell" ;
1171+ string powerShellType = ( ( psCmdlet . GetVariableValue ( "PSEdition" ) as string ) == "Core" ) ? "PowerShell" : "WindowsPowerShell" ;
11731172 localUserDir = Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . MyDocuments ) , powerShellType ) ;
11741173 allUsersDir = Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . ProgramFiles ) , powerShellType ) ;
11751174 }
@@ -1189,7 +1188,7 @@ private static void GetStandardPlatformPaths(
11891188
11901189 public static bool GetIsWindowsPowerShell ( PSCmdlet psCmdlet )
11911190 {
1192- return psCmdlet . Host . Version < PSVersion6 ;
1191+ return ( ( psCmdlet . GetVariableValue ( "PSEdition" ) as string ) != "Core" ) ;
11931192 }
11941193
11951194 /// <summary>
You can’t perform that action at this time.
0 commit comments