小编Ole*_*e K的帖子

使用vscode扩展原生读取当前git分支

在开发Visual Studio Code(vscode)扩展时,我问自己如何使用本机方法正确读取git ref像当前分支一样。

我当前的解决方案更像是一种解决方法:

  • 获取git路径
  • git rev-parse', '--abbrev-ref', 'HEAD'
  • 将stdout作为字符串返回并放入变量(例如master)

此处实现的完整方法(分支扩展gitHistoryVSCode)

还有其他想法,例如如何访问extension / git方法或模型属性?

git visual-studio-code vscode-extensions

6
推荐指数
1
解决办法
369
查看次数

Exchange 远程 Powershell 出现零星的“损坏”状态

我正在尝试通过 Windows Powershell 从远程 Exchange 服务器接收所有 TransportAgent 的状态。

我偶尔会收到一个错误,即The session state is Broken. 一旦它坏了,我需要创建一个新的会话

下面是我正在使用的命令列表(按正确顺序)

# Build the PSSession for Exchange
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<SERVER>/PowerShell/ -Authentication Default
# Invoke the command 'Get-TransportAgent' on the remote PSSession
Invoke-Command $Session {Get-TransportAgent}
# Result when there is NO ERROR
Identity                                           Enabled         Priority        PSComputerName
--------                                           -------         --------        --------------
Transport Rule Agent                               True            1               <SERVER>
Malware Agent                                      True            2               <SERVER>
Text Messaging Routing Agent                       True            3               <SERVER>
Text Messaging Delivery …
Run Code Online (Sandbox Code Playgroud)

powershell exchange-server powershell-remoting

3
推荐指数
1
解决办法
1万
查看次数