使用 PowerShell 的 StackOverflow 信誉 [英] StackOverflow reputation using PowerShell

查看:45
本文介绍了使用 PowerShell 的 StackOverflow 信誉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 PowerShell 功能查看我的声誉?

How can I view my reputation with a PowerShell function ?

推荐答案

可以使用下面的函数

Function Get-StackOverFlowReputation {
param($userID)
    $client = new-object System.Net.WebClient
    $JSONFlair = $client.DownloadString("http://stackoverflow.com/users/flair/$userid.json")
    $JSONFlair.split(",") | select-string "reputation","displayName"
}


260 >  Get-StackOverFlowReputation -userID 45571

"displayName":"Andy Schneider"
"reputation":"344"

它又快又脏.我相信您可以使用一些漂亮的库将 JSON 转换为 PSobject,但这将完成工作.

It's quick and dirty. I am sure you could use some nifty library to convert JSON to a PSobject but this will get the job done.

这篇关于使用 PowerShell 的 StackOverflow 信誉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆