PowerShell TIP – .replace vs -replace

I have been writing PowerShell scripts simple to advanced from a long time but still sometimes I get amazed with things that I come across while reviewing the automations and scripts. These are smaill things but can cause big issues if awareness is not there. We always consider Powershell as case insensitive but this scenario…

Get-IntuneManagedDevice | Get-MSGraphAllPages Stopped Fetching All Devices

We have recently faced issues with few of our automations that were fetching all the managed devices using below command: Get-IntuneManagedDevice | Get-MSGraphAllPages Our automations were working since last 2 years and suddenly in September 2021, these started giving issues, on troubleshooting more we have found that above command was only returning 950 devices whereas…

CSOM Error – Exception calling “ExecuteQuery” with “0” argument(s): The underlying connection was closed

I woke up one morning and seen majority of my scripts started failing with error: Exception calling “ExecuteQuery” with “0” argument(s): The underlying connection was closed On troubleshooting, it was found these were all scripts where I have utilized SharePoint Client Object Model (CSOM). After a thought I immediately pin pointed it to TLS 1.2…