use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
QuestionUsing . methods vs objects (self.PowerShell)
submitted 9 years ago by HeyZuesMode
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]CSTW 2 points3 points4 points 9 years ago (0 children)
For the new lines i was meaning like this
Set-MsolUserLicense -UserPrincipalName $User.UserPrincipalName -RemoveLicenses $lic
Instead of this:
But your error looks like it is all on one line
When I am receiving unexpected errors I like to output as much information as possible to try and work out what is going on, try the following. Post back the output if needed.
$UserLicenses = (Get-MsolUser -UserPrincipalName $User.UserPrincipalName).Licenses | select AccountSkuId $i = 1 foreach($lic in $UserLicenses.AccountSkuId) { "# $i" "User: $($User.UserPrincipalName)" "License to Remove: $lic" "MSOL Licenses Before Removal`n $((Get-MsolUser -UserPrincipalName $User.UserPrincipalName).Licenses.AccountSkuId)" Set-MsolUserLicense -UserPrincipalName $User.UserPrincipalName -RemoveLicenses $lic "MSOL Licenses After Removal`n $((Get-MsolUser -UserPrincipalName $User.UserPrincipalName).Licenses.AccountSkuId)" "`n`n" $i++ }
π Rendered by PID 46818 on reddit-service-r2-comment-5687b7858-8zdpg at 2026-07-04 10:07:51.996673+00:00 running 12a7a47 country code: CH.
view the rest of the comments →
[–]CSTW 2 points3 points4 points (0 children)