When using PowerShell CSOM modules for SharePoint, I randomly stumbled into the error message: Cannot convert argument query with value Microsoft.SharePoint.Client.CamlQuery. I was seeing the error when running a CAML query and calling GetItems(): $query = New-Object Microsoft.SharePoint.Client.CamlQuery $query.ViewXml = … Continue reading →
Working with strings is a common task in scripting and programming, and PowerShell provides powerful tools for manipulating and splitting strings. Two useful methods for this purpose are IndexOf and LastIndexOf. In this blog post, we’ll explore using PowerShell with … Continue reading →
In light of recent news indicating that VBScript will be removed from future Windows releases, we can assist you with converting VBScript to PowerShell using our VBScript to PowerShell conversion service! The 27 year romance with VBScript is finally coming … Continue reading →
Depending on our needs and preferences, we can run PowerShell scripts from the PowerShell Console, PowerShell Integrated Development Environment (IDE), or even from the command line. In this blog post, we’ll explore these different ways to run a PowerShell script. … Continue reading →
There are multiple methods to check if a file exists using PowerShell. In this blog post, we’ll explore two common approaches: using the Test-Path cmdlet and utilising .NET methods. Using the Test-Path Cmdlet to Check if a File Exists The … Continue reading →
The While loop allows us to repeatedly execute a block of code as long as a specified condition is met. In this blog post, we’ll explore using the PowerShell While loop. The PowerShell While Loop The While loop is a … Continue reading →
Like any programming or scripting language, errors can occur during execution. To handle and manage these errors gracefully, PowerShell provides the Try and Catch blocks. In this blog post, we’ll explore using PowerShell try and catch for handling errors. PowerShell … Continue reading →
In this blog post, we’ll explore using the PowerShell For loop and ForEach-Object cmdlet effectively in our scripts. The PowerShell For Loop The For loop is a traditional loop that allows us to execute a block of code a specified … Continue reading →
There are various situations where we may need to introduce delays or pauses in our scripts to ensure proper execution or to control the timing of specific actions. Here we demonstrate how to use PowerShell start-sleep to pause script execution. … Continue reading →
We can use Where-Object in PowerShell scripts to filter objects based on specific conditions. Where-Object is commonly used with collections like arrays and lists to extract only the elements that meet certain criteria. The basic syntax of Where-Object is as … Continue reading →