• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need help writing corresponding Powershell code in Power Query

Quste

New Member
I have this code in Powershell and I would like to have the same code in Power Query. Grateful for any help.



$uri = "https://graph.microsoft.com/beta/security/securescores"
$request = Invoke-MgGraphRequest -Uri $URI -method GET -ErrorAction Stop


foreach ($item in $request.value) {
$sspercent=($item.currentscore/$item.maxscore)
$formattedDate = $item.createdDateTime.ToString("dd-MM-yyyy")
write-host -foregroundcolor white -BackgroundColor Blue "$formattedDate Score =",$item.currentscore, "of",$item.maxscore,"["$sspercent.tostring("P")"]`n"
}





Thanks!
 

Quste

As You know from two Forums:
  • Cross-Posting. Generally, it is considered poor practice to cross post. That is to post the same question on several forums in the hope of getting a response quicker.
  • If you do cross-post, please put that in your post.
  • Also if you have cross-posted and get an Solution elsewhere, have the courtesy of posting the Solution here so other readers can learn from the answer also, as well as stopping people wasting their time on your answered question.
These rules are for everyone:
 
Back
Top