From 62aee9356a63fd897f4d89087c4994b5269f3a36 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Mon, 13 Jan 2020 19:21:53 +0000 Subject: [PATCH] Correct case of $PSScriptRoot special variable --- build.psm1 | 2 +- docker/tests/containerTestCommon.psm1 | 4 ++-- .../engine/ResourceValidation/CimCmdletsResources.Tests.ps1 | 2 +- .../engine/ResourceValidation/ConsoleHostResources.Tests.ps1 | 2 +- .../ResourceValidation/DotNetEventingResources.Tests.ps1 | 2 +- .../ResourceValidation/ManagementCommandsResources.Tests.ps1 | 2 +- .../engine/ResourceValidation/SMAResources.Tests.ps1 | 2 +- .../engine/ResourceValidation/SecurityResources.Tests.ps1 | 2 +- test/powershell/engine/ResourceValidation/TestRunner.ps1 | 2 +- .../engine/ResourceValidation/UtilityResources.Tests.ps1 | 2 +- .../engine/ResourceValidation/WSManResources.Tests.ps1 | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build.psm1 b/build.psm1 index 7565e369c6..d1b75818ac 100644 --- a/build.psm1 +++ b/build.psm1 @@ -498,7 +498,7 @@ Fix steps: $psVersion = $ReleaseTag } else { - $psVersion = git --git-dir="$PSSCriptRoot/.git" describe + $psVersion = git --git-dir="$PSScriptRoot/.git" describe } if ($Environment.IsRedHatFamily -or $Environment.IsDebian) { diff --git a/docker/tests/containerTestCommon.psm1 b/docker/tests/containerTestCommon.psm1 index 4816812b64..4e93263ea8 100644 --- a/docker/tests/containerTestCommon.psm1 +++ b/docker/tests/containerTestCommon.psm1 @@ -72,7 +72,7 @@ function Get-LinuxContainer { Write-Output @{ Name = $os - Path = "$psscriptroot/../release/$os" + Path = "$PSScriptRoot/../release/$os" } } } @@ -84,7 +84,7 @@ function Get-WindowsContainer { Write-Output @{ Name = $os - Path = "$psscriptroot/../release/$os" + Path = "$PSScriptRoot/../release/$os" } } } diff --git a/test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1 index e7e849b06c..c60985d511 100644 --- a/test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -. "$psscriptroot/TestRunner.ps1" +. "$PSScriptRoot/TestRunner.ps1" $assemblyName = "Microsoft.Management.Infrastructure.CimCmdlets" diff --git a/test/powershell/engine/ResourceValidation/ConsoleHostResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/ConsoleHostResources.Tests.ps1 index 0f6c3367f8..3c8eecdd34 100644 --- a/test/powershell/engine/ResourceValidation/ConsoleHostResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/ConsoleHostResources.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -. "$psscriptroot/TestRunner.ps1" +. "$PSScriptRoot/TestRunner.ps1" $AssemblyName = "Microsoft.PowerShell.ConsoleHost" diff --git a/test/powershell/engine/ResourceValidation/DotNetEventingResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/DotNetEventingResources.Tests.ps1 index 9bd8992c3d..d53858ba3e 100644 --- a/test/powershell/engine/ResourceValidation/DotNetEventingResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/DotNetEventingResources.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -. "$psscriptroot/TestRunner.ps1" +. "$PSScriptRoot/TestRunner.ps1" $assemblyName = "Microsoft.PowerShell.CoreCLR.Eventing" diff --git a/test/powershell/engine/ResourceValidation/ManagementCommandsResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/ManagementCommandsResources.Tests.ps1 index ae242d3712..ea6b1576fd 100644 --- a/test/powershell/engine/ResourceValidation/ManagementCommandsResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/ManagementCommandsResources.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -. "$psscriptroot/TestRunner.ps1" +. "$PSScriptRoot/TestRunner.ps1" $AssemblyName = "Microsoft.PowerShell.Commands.Management" # excluded resources, taken from the 'EmbeddedResource Remove' diff --git a/test/powershell/engine/ResourceValidation/SMAResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/SMAResources.Tests.ps1 index d03788a4d5..e8d7cf8bcf 100644 --- a/test/powershell/engine/ResourceValidation/SMAResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/SMAResources.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -. "$psscriptroot/TestRunner.ps1" +. "$PSScriptRoot/TestRunner.ps1" $AssemblyName = "System.Management.Automation" # excluded resources, taken from the 'EmbeddedResource Remove' diff --git a/test/powershell/engine/ResourceValidation/SecurityResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/SecurityResources.Tests.ps1 index d58bf385fc..227d17bd4f 100644 --- a/test/powershell/engine/ResourceValidation/SecurityResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/SecurityResources.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -. "$psscriptroot/TestRunner.ps1" +. "$PSScriptRoot/TestRunner.ps1" $assemblyName = "Microsoft.PowerShell.Security" diff --git a/test/powershell/engine/ResourceValidation/TestRunner.ps1 b/test/powershell/engine/ResourceValidation/TestRunner.ps1 index 05bbf6107c..e3c6cb5264 100644 --- a/test/powershell/engine/ResourceValidation/TestRunner.ps1 +++ b/test/powershell/engine/ResourceValidation/TestRunner.ps1 @@ -6,7 +6,7 @@ function Test-ResourceStrings # determine the needed resource directory. If these tests are moved # this logic will need to change - $repoBase = (Resolve-Path (Join-Path $psScriptRoot ../../../..)).Path + $repoBase = (Resolve-Path (Join-Path $PSScriptRoot ../../../..)).Path $asmBase = Join-Path $repoBase "src/$AssemblyName" $resourceDir = Join-Path $asmBase resources $resourceFiles = Get-ChildItem $resourceDir -Filter *.resx -ErrorAction stop | diff --git a/test/powershell/engine/ResourceValidation/UtilityResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/UtilityResources.Tests.ps1 index a50245439d..5633584bcb 100644 --- a/test/powershell/engine/ResourceValidation/UtilityResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/UtilityResources.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -. "$psscriptroot/TestRunner.ps1" +. "$PSScriptRoot/TestRunner.ps1" $AssemblyName = "Microsoft.PowerShell.Commands.Utility" # excluded resources, taken from the 'EmbeddedResource Remove' diff --git a/test/powershell/engine/ResourceValidation/WSManResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/WSManResources.Tests.ps1 index c2154dc46d..c4741f1e12 100644 --- a/test/powershell/engine/ResourceValidation/WSManResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/WSManResources.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -. "$psscriptroot/TestRunner.ps1" +. "$PSScriptRoot/TestRunner.ps1" $assemblyName = "Microsoft.WSMan.Management"