Skip to content

Search

Captain 365

Captain 365

Exploring the Azure blue seas

  • Home
  • Captains Blog
    • Microsoft 365
    • Office 365
    • Powershell
    • Azure Cloud
    • Azure Security
  • Captains Knowledgebase
  • About

Powershell

Create a Shortcut to start Apps with Admin privileges with Powershell

10-09-2023 by Captain 365
Create a Shortcut to start Apps with Admin privileges with Powershell

The challenge I want t be able to start some application with Admin privileges without the UAC nagg screen prompting. To accomplish this you need to create a task in the Windows Task Scheduler. One of the options is: to Run with highest privileges. After you have created the task then you create a Shortcut … Read more

Categories Powershell Tags automate, powershell Leave a comment

Powershell will always return array and $array.count wil always be a number.

09-06-2021 by Captain 365

Powershell Gotcha:If you want to guarantee that you always get an array from a function, wrap the call with @(). $m = @(Get-AzureADGroupMember -ObjectId $g )$m.count will always be a number.

Categories Powershell Leave a comment

Storing data items in generic list PSobject

13-01-202109-07-2020 by Captain 365

$List = [System.Collections.Generic.List[Object]]::new(); $ListItem = [PSCustomObject][Ordered]@{FieldName = $SomeValueOtherFieldName = “SomeValue”YetAnotherFieldName = $true } $List.Add($ListItem)

Categories Powershell Leave a comment

else: The term ‘else’ is not recognized as the name of a cmdlet, function, script file, or operable program

05-07-2020 by Captain 365

Error: powershell else: The term ‘else’ is not recognized as the name of a cmdlet, function, script file, or operable program. vscode gave me this error. When i researched this i found out it was caused because of the if else statement was on several lines. So After I have searched the web and tried … Read more

Categories Powershell Leave a comment

PowerShell unable to resolve package source

03-06-2020 by Captain 365

When i was installing new modules and updating existing modules i got this error / warning: WARNING: Unable to resolve package source ‘https://www.powershellgallery.com/api/v2’. and was looking for an answer to fix this. The problem was on the Windows Server 2016. I did not have the problem on my workstation at home. I found this thread … Read more

Categories Powershell Tags error, psgallery, warning Leave a comment

Connecting Powershell with Office 365 using credential manager

11-05-2020 by Captain 365

I use a script made by Michel de Rooij which is updated regularly. I can recommend using this script. You can find it here. I have altered this a bit so I don’t have to add my credentials every time. One of the safest ways I could find to add my credentials without exposing them … Read more

Categories Office 365, Powershell Tags connect, credential manager, credentials Leave a comment

Search this Ship

Recent Posts

  • Test syncblock3
  • Linux Commands
  • How to Stop Procrastinating [VIDEO]
  • Elementor #478
  • Create a Shortcut to start Apps with Admin privileges with Powershell

Some usefull Links

Captains Github

Categories

© 2025 Captain 365 • Built with GeneratePress