/
githubmirror
/
PowerShell
Обзор
Документация
Войти
/
githubmirror
/
PowerShell
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/System.Management.Automation/engine/remoting/commands/PopRunspaceCommand.cs
40 строк
1 KB
Dongbo Wang
Revert "Use `is null` syntax (#13277)" (#13322)
31 июл 2020, 02:06
Не верифицирован
31 июл 2020, 02:06
4b9b078
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Management.Automation; using System.Management.Automation.Host; using System.Management.Automation.Remoting; using Dbg = System.Management.Automation.Diagnostics; namespace Microsoft.PowerShell.Commands { /// <summary> /// Exit-PSSession cmdlet. /// </summary> [Cmdlet(VerbsCommon.Exit, "PSSession", HelpUri = "https://go.microsoft.com/fwlink/?LinkID=2096787")] public class ExitPSSessionCommand : PSRemotingCmdlet { /// <summary> /// Process record. /// </summary> protected override void ProcessRecord() { // Pop it off the local host. IHostSupportsInteractiveSession host = this.Host as IHostSupportsInteractiveSession; if (host == null) { WriteError( new ErrorRecord( new ArgumentException(GetMessage(RemotingErrorIdStrings.HostDoesNotSupportPushRunspace)), nameof(PSRemotingErrorId.HostDoesNotSupportPushRunspace), ErrorCategory.InvalidArgument, null)); return; } host.PopRunspace(); } } }