Practical solutions

PowerShell Howtos How-To Guides

Solve the problem. Keep building. Collection of Windows powershell how-to articles

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

How to Get All Group Membership of a User Using PowerShellCompare four ways to list a user's Active Directory group memberships with PowerShell, including their prerequisites and the scope of their results. How to Perform LDAP Queries in PowerShellPrepare the Active Directory module, then choose PowerShell expression filters or LDAP search filters for directory queries. Check for Null Values in PowerShellLearn what PowerShell's $null automatic variable represents, how it behaves in expressions and collections, and which comparison or string check to use. How to Run a PowerShell Script Without Displaying a WindowRun PowerShell scripts with a hidden window or Task Scheduler, and understand launch-context limits, batch files, and service alternatives. How to Handle Errors Using Try-Catch Block in PowerShellThis article will discuss error action preferences in PowerShell and how we can intercept them to perform error handling using the PowerShell Try Catch and Finally blocks. PowerShell With Robocopy and Arguments PassingLearn how to copy files and directories with robocopy from PowerShell, including how to pass options as separate arguments. How to Copy Files From Windows to Linux Using PowerShellLearn the command forms for copying files and folders from Windows to Linux with scp or PuTTY's pscp in PowerShell. How to Copy and Paste From a Variable in PowerShellWe use the Set-Clipboard cmdlet on PowerShell to determine the content of our clipboard. We then use the Get-Clipboard cmdlet to fetch and use the clipboard's content. How to Export Output to Text File in PowerShellThis article shows ways to export the PowerShell output of a common command to a text file. How to Create an Array, Hash Table, and Dictionary in PowerShellLearn how to create and use arrays, hash tables, and ordered dictionaries in PowerShell with this comprehensive guide. Understand the key differences, how to access, add, and remove items, and when to use each data structure. Includes practical examples, real-world use cases, and an FAQ section to help you master PowerShell scripting and data manipulation efficiently. Perfect for beginners and advanced users looking to enhance automation and data organization in PowerShell. How to Move Files and Folders Using PowerShellLearn how to check paths, create files and folders, and move them with PowerShell. How to Parse XML Files Using PowerShellUse Select-Xml, XmlDocument, or XmlTextReader in PowerShell to extract XML elements and attributes. How to Get List of Running Processes in PowerShellUse PowerShell Get-Process to list local processes, filter by name, inspect process properties, and request the associated account on Windows. How to Delete a Certificate From a Windows Certificate Store Using PowerShellLearn how to find a certificate in a Windows certificate store, remove it with PowerShell, choose whether to delete its private key, and check the store afterward. How to Get Exit Code From Start-Process in PowerShellThis article will explain how to obtain the exit code after running a script with the start-process cmdlet. How to Get Date and Time Using PowerShellThis article will explain how we can get the current date and time, and how the DateTime object works in PowerShell. How to Open a Folder Using PowerShellThis tutorial will teach you to open a folder using PowerShell. How to Terminate a Script in Windows PowerShellLearn when to use exit, return, throw, break, continue, or Stop-Process to end the correct scope and report a reliable PowerShell exit code. How to Jump Around to Certain Spots in PowerShell ScriptPowerShell has no GOTO command. Learn how to jump to named spots with functions, branch with if and switch, repeat with while and for, and exit nested loops with labeled break and continue. Base64 Encoding in Windows PowerShellThis article explores Base64 encoding in Windows PowerShell, providing methods for encoding and decoding Base64 strings. Learn how to manage Base64 strings efficiently, even without native commands, and discover how to apply these techniques in Git for better data management. How to Get String Length of a Variable in PowerShellThis tutorial will teach you how to get the string length of a variable in PowerShell. Explore different methods such as using the .Length property, Measure-Object cmdlet, and string methods to effectively manage strings in your scripts. Enhance your PowerShell skills and streamline your automation tasks with these essential techniques. How to Run Executable Files in PowerShellThis article demonstrates various methods to run executable files in Windows PowerShell, including how to execute them silently. Learn to use Start-Process, the call operator, and PowerShell Remoting for efficient execution of .exe files. Whether you're a developer or a system administrator, this guide provides practical code examples and detailed explanations to enhance your PowerShell skills. How to Copy File to Remote Computer in PowerShellLearn how to copy files to a remote computer using PowerShell in this comprehensive guide. Explore methods like the Copy-Item cmdlet, Invoke-Command, and SMB protocol for efficient file transfers. Enhance your productivity and streamline your workflows with these practical PowerShell techniques. How to Get User Organizational Unit Using PowerShellThis article discusses how to query for the organizational unit of the Active Directory user object using PowerShell. Learn effective methods to retrieve user details quickly and efficiently. Explore the use of cmdlets like Get-ADUser, and enhance your Active Directory management skills today.