File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1207,15 +1207,14 @@ private static string GetHomeOrCreateTempHome()
12071207 return s_tempHome ;
12081208 }
12091209
1210- private readonly static Version PSVersion6 = new Version ( 6 , 0 ) ;
12111210 private static void GetStandardPlatformPaths (
12121211 PSCmdlet psCmdlet ,
12131212 out string localUserDir ,
12141213 out string allUsersDir )
12151214 {
12161215 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
12171216 {
1218- string powerShellType = ( psCmdlet . Host . Version >= PSVersion6 ) ? "PowerShell" : "WindowsPowerShell" ;
1217+ string powerShellType = ( ( psCmdlet . GetVariableValue ( "PSEdition" ) as string ) == "Core" ) ? "PowerShell" : "WindowsPowerShell" ;
12191218 localUserDir = Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . MyDocuments ) , powerShellType ) ;
12201219 allUsersDir = Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . ProgramFiles ) , powerShellType ) ;
12211220 }
@@ -1235,7 +1234,7 @@ private static void GetStandardPlatformPaths(
12351234
12361235 public static bool GetIsWindowsPowerShell ( PSCmdlet psCmdlet )
12371236 {
1238- return psCmdlet . Host . Version < PSVersion6 ;
1237+ return ( ( psCmdlet . GetVariableValue ( "PSEdition" ) as string ) != "Core" ) ;
12391238 }
12401239
12411240 /// <summary>
You can’t perform that action at this time.
0 commit comments