格式powershell输出至最低
我正在从QProcess
中调用PowerShell
QProcess p;
p.start("powershell.exe", QStringList() << "get-wmiobject win32_networkadapter -filter 'netconnectionstatus = 2' | select netconnectionid");
if (p.waitForFinished())
while(p.canReadLine())
{
auto line = QString::fromStdString(p.readLine().toStdString());
qDebug() << line;
}
,从QTCreator输出中,我
"\r\n"
"\r\n"
"netconnectionid : Ethernet\r\n"
"\r\n"
"netconnectionid : VirtualBox Host-Only Network\r\n"
"\r\n"
"\r\n"
"\r\n"
想将PowerShell输出降低到
"Ethernet"
"VirtualBox Host-Only Network"
如何将PowerShell输出格式化为最小值?
I'm calling Powershell from QProcess
QProcess p;
p.start("powershell.exe", QStringList() << "get-wmiobject win32_networkadapter -filter 'netconnectionstatus = 2' | select netconnectionid");
if (p.waitForFinished())
while(p.canReadLine())
{
auto line = QString::fromStdString(p.readLine().toStdString());
qDebug() << line;
}
From that, on QtCreator output, I see
"\r\n"
"\r\n"
"netconnectionid : Ethernet\r\n"
"\r\n"
"netconnectionid : VirtualBox Host-Only Network\r\n"
"\r\n"
"\r\n"
"\r\n"
I would like to reduce Powershell output to
"Ethernet"
"VirtualBox Host-Only Network"
How to format Powershell output to a minimum?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论