mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Rename 'PowerShellProperties.json' to 'powershell.config.json'
This commit is contained in:
@@ -29,7 +29,7 @@ namespace System.Management.Automation.Configuration
|
||||
|
||||
private string psHomeConfigDirectory;
|
||||
private string appDataConfigDirectory;
|
||||
private const string configFileName = "PowerShellProperties.json";
|
||||
private const string configFileName = "powershell.config.json";
|
||||
|
||||
/// <summary>
|
||||
/// Lock used to enable multiple concurrent readers and singular write locks within a single process.
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\powershell\Program.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
||||
<Content Include="..\System.Management.Automation\PowerShellProperties.json">
|
||||
<Link>PowerShellProperties.json</Link>
|
||||
<Content Include="..\System.Management.Automation\powershell.config.json">
|
||||
<Link>powershell.config.json</Link>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Include="..\Modules\Windows-Core\**\*;..\Modules\Windows-Core+Full\**\*;..\Modules\Shared\**\*">
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace PSTests.Sequential
|
||||
{
|
||||
public class PowerShellPolicyFixture : IDisposable
|
||||
{
|
||||
private const string configFileName = "powershell.config.json";
|
||||
private readonly string systemWideConfigFile;
|
||||
private readonly string currentUserConfigFile;
|
||||
|
||||
@@ -39,8 +40,8 @@ namespace PSTests.Sequential
|
||||
Directory.CreateDirectory(currentUserConfigDirectory);
|
||||
}
|
||||
|
||||
systemWideConfigFile = Path.Combine(systemWideConfigDirectory, "PowerShellProperties.json");
|
||||
currentUserConfigFile = Path.Combine(currentUserConfigDirectory, "PowerShellProperties.json");
|
||||
systemWideConfigFile = Path.Combine(systemWideConfigDirectory, configFileName);
|
||||
currentUserConfigFile = Path.Combine(currentUserConfigDirectory, configFileName);
|
||||
|
||||
if (File.Exists(systemWideConfigFile))
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Functional tests to verify basic conditions for IO to the PowerShellProperties.json files
|
||||
# Functional tests to verify basic conditions for IO to the powershell.config.json files
|
||||
# The properties files are supported on non-Windows OSes, but the tests are specific to
|
||||
# Windows so that file IO can be verified using supported cmdlets.
|
||||
#
|
||||
@@ -14,18 +14,18 @@ try {
|
||||
$IsNotSkipped = ($IsWindows -and !$IsInbox) # Only execute for PowerShell Core on Windows
|
||||
$PSDefaultParameterValues["it:skip"] = !$IsNotSkipped
|
||||
|
||||
Describe "User-Specific PowerShellProperties.json Modifications" -Tags "CI" {
|
||||
Describe "User-Specific powershell.config.json Modifications" -Tags "CI" {
|
||||
|
||||
BeforeAll {
|
||||
if ($IsNotSkipped) {
|
||||
# Discover the user-specific PowerShellProperties.json file
|
||||
# Discover the user-specific powershell.config.json file
|
||||
$userSettingsDir = [System.IO.Path]::Combine($env:USERPROFILE, "Documents", $productName)
|
||||
$userPropertiesFile = Join-Path $userSettingsDir "PowerShellProperties.json"
|
||||
$userPropertiesFile = Join-Path $userSettingsDir "powershell.config.json"
|
||||
|
||||
# Save the file for restoration after the tests are complete
|
||||
$backupPropertiesFile = ""
|
||||
if (Test-Path $userPropertiesFile) {
|
||||
$backupPropertiesFile = Join-Path $userSettingsDir "ORIGINAL_PowerShellProperties.json"
|
||||
$backupPropertiesFile = Join-Path $userSettingsDir "ORIGINAL_powershell.config.json"
|
||||
Copy-Item -Path $userPropertiesFile -Destination $backupPropertiesFile -Force -ErrorAction Continue
|
||||
}
|
||||
elseif (-not (Test-Path $userSettingsDir)) {
|
||||
@@ -49,12 +49,12 @@ try {
|
||||
if ($IsNotSkipped) {
|
||||
if (-not $backupPropertiesFile)
|
||||
{
|
||||
# Remove PowerShellProperties.json if it did not exist before the tests
|
||||
# Remove powershell.config.json if it did not exist before the tests
|
||||
Remove-Item -Path $userPropertiesFile -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
else
|
||||
{
|
||||
# Restore the original PowerShellProperties.json file if it existed before the test pass.
|
||||
# Restore the original powershell.config.json file if it existed before the test pass.
|
||||
Move-Item -Path $backupPropertiesFile -Destination $userPropertiesFile -Force -ErrorAction Continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user