Skip to content

Enable nullable: Microsoft.PowerShell.Commands.IRegistryWrapper#14177

Merged
iSazonov merged 2 commits into
PowerShell:masterfrom
powercode:nullable/IRegistryWrapper
May 20, 2021
Merged

Enable nullable: Microsoft.PowerShell.Commands.IRegistryWrapper#14177
iSazonov merged 2 commits into
PowerShell:masterfrom
powercode:nullable/IRegistryWrapper

Conversation

@powercode
Copy link
Copy Markdown
Collaborator

Tracking issue: #12631.

@powercode powercode requested a review from anmenaga as a code owner November 19, 2020 23:40
@ghost ghost assigned TravisEz13 Nov 19, 2020
@ghost ghost added the Review - Needed The PR is being reviewed label Nov 28, 2020
@ghost
Copy link
Copy Markdown

ghost commented Nov 28, 2020

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@iSazonov
Copy link
Copy Markdown
Collaborator

@powercode Please resolve merge conflicts.

@ghost ghost removed the Review - Needed The PR is being reviewed label Dec 11, 2020
@powercode powercode force-pushed the nullable/IRegistryWrapper branch from 362a583 to 0bff675 Compare December 14, 2020 09:19
@ghost ghost added the Review - Needed The PR is being reviewed label Dec 21, 2020
@ghost
Copy link
Copy Markdown

ghost commented Dec 21, 2020

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@iSazonov
Copy link
Copy Markdown
Collaborator

/azp run

@ghost ghost removed the Review - Needed The PR is being reviewed label May 18, 2021
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 5 pipeline(s).

@iSazonov
Copy link
Copy Markdown
Collaborator

/azp list

@azure-pipelines
Copy link
Copy Markdown

@iSazonov iSazonov closed this May 18, 2021
@iSazonov iSazonov reopened this May 18, 2021
@iSazonov iSazonov closed this May 18, 2021
@iSazonov iSazonov reopened this May 18, 2021
void SetValue(string? name, object value);

void SetValue(string name, object value, RegistryValueKind valueKind);
void SetValue(string? name, object value, RegistryValueKind valueKind);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean to set a null-named key in the registry?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From docs: https://docs.microsoft.com/en-us/dotnet/api/microsoft.win32.registrykey.setvalue?view=net-5.0#Microsoft_Win32_RegistryKey_SetValue_System_String_System_Object_

A registry key can have one value that is not associated with any name. When this unnamed value is displayed in the registry editor, the string "(Default)" appears instead of a name. To set this unnamed value, specify either null or the empty string ("") for name.

string[] GetSubKeyNames();

IRegistryWrapper CreateSubKey(string subkey);
IRegistryWrapper? CreateSubKey(string subkey);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is null returned when create fails?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From docs: https://docs.microsoft.com/en-us/dotnet/api/microsoft.win32.registrykey.createsubkey?view=net-5.0#Microsoft_Win32_RegistryKey_CreateSubKey_System_String_

Returns
RegistryKey
The newly created subkey, or null if the operation failed. If a zero-length string is specified for subkey, the current RegistryKey object is returned.

void DeleteSubKeyTree(string subkey);

object GetValue(string name);
object? GetValue(string? name);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is null returned when the key doesn't exist?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iSazonov
Copy link
Copy Markdown
Collaborator

/azp run PowerShell-CI-Windows-daily

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@iSazonov iSazonov assigned iSazonov and unassigned TravisEz13 May 20, 2021
@iSazonov iSazonov added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label May 20, 2021
@iSazonov iSazonov merged commit e927e94 into PowerShell:master May 20, 2021
@iSazonov iSazonov added this to the 7.2.0-preview.6 milestone May 20, 2021
@powercode powercode deleted the nullable/IRegistryWrapper branch May 25, 2021 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants