/
githubmirror
/
PowerShell
Обзор
Документация
Войти
/
githubmirror
/
PowerShell
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandModuleInfo.cs
47 строк
1 KB
CarloToso
Replace ArgumentNullException(nameof()) -> ArgumentNullException.ThrowIfNull() (#18784)
14 дек 2022, 16:30
Не верифицирован
14 дек 2022, 16:30
2ddc63f
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Management.Automation; namespace Microsoft.PowerShell.Commands.ShowCommandExtension { /// <summary> /// Implements a facade around PSModuleInfo and its deserialized counterpart. /// </summary> public class ShowCommandModuleInfo { /// <summary> /// Initializes a new instance of the <see cref="ShowCommandModuleInfo"/> class /// with the specified <see cref="CommandInfo"/>. /// </summary> /// <param name="other"> /// The object to wrap. /// </param> public ShowCommandModuleInfo(PSModuleInfo other) { ArgumentNullException.ThrowIfNull(other); this.Name = other.Name; } /// <summary> /// Initializes a new instance of the <see cref="ShowCommandModuleInfo"/> class /// with the specified <see cref="PSObject"/>. /// </summary> /// <param name="other"> /// The object to wrap. /// </param> public ShowCommandModuleInfo(PSObject other) { ArgumentNullException.ThrowIfNull(other); this.Name = other.Members["Name"].Value as string; } /// <summary> /// Gets the name of this module. /// </summary> public string Name { get; } } }