Click here to Skip to main content
15,881,424 members
Everything / Programming Languages / PowerShell

PowerShell

PowerShell

Great Reads

by The Ænema
This article will teach you how to create an amazing, clean and smooth WPF/Winform UI for your native application without using any complex, unsafe, ActiveXish methods, etc.
by Daniel Miller
This article describes the C# implementation for a high-performance user/role security principal hierarchy.
by Jo_vb.net
This article and the demo are about getting started using the MVVM Toolkit and some self-created interfaces / services for MessageBox and some dialogs.
by Christian Vos
How to use Microsoft Unity Interception as a solution for cross cutting concerns in a .NET application

Latest Articles

by Federico Di Marco
A tool which creates one or more Powershell scripts which in turn recreate one or more binary files
by Wessel Beulink
Azure spearheads cloud evolution, Azure Automation Runbooks manage hybrid/SOC environments effectively
by Federico Di Marco
How to enable Bitlocker hardware encryption on self encrypting drives
by Federico Di Marco
Create quickly VPN connections in Windows according to a XML configuration file

All Articles

Sort by Score

PowerShell 

6 Jan 2020 by The Ænema
This article will teach you how to create an amazing, clean and smooth WPF/Winform UI for your native application without using any complex, unsafe, ActiveXish methods, etc.
5 Dec 2015 by Daniel Miller
This article describes the C# implementation for a high-performance user/role security principal hierarchy.
27 Feb 2023 by Jo_vb.net
This article and the demo are about getting started using the MVVM Toolkit and some self-created interfaces / services for MessageBox and some dialogs.
27 Nov 2015 by Christian Vos
How to use Microsoft Unity Interception as a solution for cross cutting concerns in a .NET application
8 Aug 2017 by Afzaal Ahmad Zeeshan, Iqra Ali
Since I wrote an article previously, I had been asked on various occasions to share the code on Yahoo! or Bing, etc. I wanted to write an article, with the code, which covers all of those vendors as well.
17 Nov 2017 by Daniele Fontani
A powershell script that monitors webs sites and trace logs into database.
12 Apr 2015 by Shining Dragon
A look into how we can achieve multi threading in our Powershell scripts
1 Sep 2018 by Arthur V. Ratz
In this brief article, we will demonstrate how to deploy a Node.js application and run it on Docker's Windows Server Core 2016 Containers
20 Mar 2023 by Bogdan Marian
Ensure your Docker Compose services start in the correct order
30 Apr 2012 by Luke Jefferson
Learn how to configure SMS alerts to fire based on your Windows Azure application deployment status.
14 Jan 2020 by Chris A. Johnson
This article explains exactly how to setup an SSL certificate for FREE on your Azure account. The existing free SSL with Azure only works on 'non-naked' domains, making it pretty much worthless. This is a 100% free method which ensures your site will be 100% secure.
1 Nov 2020 by awilson9010
Working with Windows BCD store in Powershell
22 Dec 2023 by Federico Di Marco
How to enable Bitlocker hardware encryption on self encrypting drives
21 Feb 2012 by Sergey Alexandrovich Kryukov
This is a well-known thing, which is implemented in the class System.Management.Automation.PowerShell, please see: http://msdn.microsoft.com/en-us/library/system.management.automation.powershell%28v=vs.85%29.aspx[^].You can find a simple code sample...
17 May 2016 by Ron Bos
I wrote this small PowerShell script to quickly access some AbstractSpoon ToDoList documents which are stored in VeraCrypt containers. The selected container stays mounted until the ToDoList executable is closed. I use OneDrive to automatically upload the then dismounted container to the cloud.
11 Jul 2016 by Jesus Carroll
Despite the references of several sources of unattended installation of Microsoft SQL Server Database Engine, in this article describes a script tested in real production environments and it can be used with minimal or - perhaps - no modifications.
15 Jun 2022 by Tomasz Malicki
How to create a dynamic object in C # containing the results of a command executed in PowerShell.
16 Aug 2010 by shappell
A Script for determing the levenshtein distance between two strings in PowerShell
20 Sep 2010 by Ali BaderEddin
Restore an SQL database on a local or remote SQL server using PowerShell
17 Aug 2011 by Milind R Chavan
Create MySQL Database backup using mysqldump
10 Jul 2014 by RoboJRR
How to use Powershell to query webservices.
28 Oct 2014 by Sacha Barber
PowerShell: Create MSMQ
29 Oct 2014 by Mohamed Meligy
How to use Visual Studio developer command prompt with Powershell
24 Nov 2014 by Sacha Barber
How to use PowerShell to carry out REST operations such as GET/POST
14 Dec 2015 by Member 12014821
PowerShell for Office 365
22 Dec 2015 by 2irfanshaikh
Use SharePoint Commandlets in Windows PowerShell ISE
9 Jan 2017 by dandy72
Copy removable media more quickly by eliminating all the usual repetitive application interaction steps you normally have to go through.
18 Oct 2020 by Mohssine EL HARFI
26 Nov 2020 by H. Hasanov
ScoopBox is a C# library that automates the configuration file building and generates a script which inside contains commands to execute using PowerShell.
22 Dec 2020 by Marijan Nikic
A simple solution using Powershell for preparing emails from Windows batch in Outlook; supports HTML body
14 Jun 2023 by Leszek Koc
Auto subscription of Azure functions to Event Grid
13 Nov 2023 by Zijian
Use PowerShell scripts to generate icons of native mobile apps
20 Sep 2010 by Uros Calakovic
I encountered a problem while trying to use WPF UI Automation with PowerShell - PowerShell reported incorrect type for automation elements
10 Feb 2011 by Nish Nishant
Typically this is done through named arguments. Example:filename:abc.txt color:redNow the order of the parameters don't matter.
3 Oct 2011 by Espen Harlinn
This is one of the really good articles on the subject:Extend Windows PowerShell With Custom Commands[^]Best regardsEspen Harlinn
24 Oct 2011 by manibe2k5
This article will assist you to deliver/deploy your Sharepoint site and its features using Powershell
19 Dec 2012 by Sergey Alexandrovich Kryukov
By the way, found that Microsoft official documentation on PowerShell is prohibitively bad, even though v.3.0 is finally made well usable; and Intellisense is quite good. The best book I saw so far is this one: http://www.pavleck.net/powershell-cookbook/[^].The problem with tar is: you would...
19 Dec 2012 by Espen Harlinn
Apart from what Sergey mentions - you have a few other options:Windows Services for Unix[^] - provides a very complete Unix subsystem on WindowsMinGW[^] - the minimalist GNU for WindowsCygwin[^]All of them are free and allows you to continue using your bash scripts on...
30 Oct 2013 by Manoj.Kumar12
Authentication against CRM contact using custom STS
2 Mar 2014 by Matthias Kainer
Registering your powershell modules on demand with PSReg
26 Nov 2014 by Zhuyun Dai
Describes how to resolve the 'Double-Hop' issue in PowerShell remoting and how to troubleshoot issues we may meet.
31 Mar 2015 by Andy Lanng
if this is a winforms application (the "MessageBox.Show" says that it is) then hitting space will trigger an event depending on which control has focus. private void form1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == ' ') ps.AddScript("netsh...
20 May 2015 by Matt Perdeck
A fully functional sample Cloudformation template that generates a load balanced IIS/SQL Server based web site, plus PowerShell scripts to automatically deploy the web site on your EC2 instances
4 Jun 2015 by Sacha Barber
Powershell: Get process stats
30 Nov 2015 by Sarkis Matossian
Encoding a .NET assembly as a hex string to install in SQL Server.
29 Jul 2015 by LalithGallage
This powershell script is you to monitor windows servers’ free hard disk and populate it to sharepoint custom list.
6 Dec 2015 by Krishna P Seetharaman
This tip explains about a way using PowerShell to monitor all the disabled send ports/receive locations and suspended messages and send an email about these info
19 Dec 2015 by dineshiam
This tip will give an overview to Sitecore developer about how to migrate data using Sitecore PowerShell scripts.
9 Feb 2016 by Jim Roth
Use PowerShell Post-build scripts to check in binaries to TFS for continuous integration during the build process.
1 Mar 2016 by Dave Kreskowiak
You need to find out what's failing and then convert that code into something that works on an older PowerShell.There is no "automatic" or "setting" you can use or change to magically get it to work. Your code is using some feature that was introduced with PowerShell 2.0 that isn't available...
17 May 2016 by MarkHawes
Ugh, WIFI not working or unstable? Try this tip....
4 Oct 2016 by Shawn K Lewis
Powershell script for Amazon Dash button Detection via DHCP Discover message
28 Nov 2016 by Sujay Sarma
PowerShell script to split single-file routines export from MySQL Server
6 May 2017 by Tibor Blazko
Example usage of The Old Reader's and Inoreader's APIs
8 Dec 2016 by Sujay Sarma
PowerShell Script to Automate Hyper V Snapshots
8 Dec 2016 by Sujay Sarma
Here is a script to create an event source using PowerShell
17 May 2017 by Jochen Arndt
You are searching for product names containing "antivirus". So you will not find software that does not contain that string. You might even find software that is not an AV software. If you still want to use the Name property you have to search for strings that are used by the common AV...
30 Apr 2018 by Ryan G Conrad
Using Powershell and Windows Task Scheduler API to detect malicious login attempts on a remotely accessible SQL Server database
28 Jun 2018 by RamanaReddy V
Login to your VPN through CISCO with single mouse click jump to your VPN system below 30 seconds..!
31 Dec 2018 by Randy Kroeger
This article provides an example on how you can change application configuration settings within an existing ClickOnce publish, update the manifest files, followed by using the Mage utility for updating the manifest using the existing cert file.
21 May 2019 by Tom Ling
How to export VS code extensions to another computer using PowerShell
20 Nov 2019 by Jeremy Likness
How to customize the new Windows Terminal for Windows 10 for custom font, look and feel, as well as setup terminals for git-bash, Node.js, PowerShell, and Azure Cloud Shell.
8 Feb 2020 by OwenDavies
When you create an Azure Storage account to store files in a container you can set the permissions to what ever access level you want, and you can generate tokens to access the blob storage account with set periods of time. That’s what we’re going to do here today.. 0.
12 Mar 2020 by Kevin Mack
What kinds of things should I avoid, or remove from my applications to improve my position moving forward
29 Jun 2020 by Member 14874449
Walk-through and source code for an Excel VBA development workflow
20 Jun 2021 by Aditya-Sharma0712
How to set classification label to an Excel/Word/PDF file at the time of its creation during runtime programmatically
9 Aug 2021 by Richard Deeming
You are disabling inheritance on every folder in the path. Each subfolder will have its own set of ACLs, which will potentially be different to the ACL on its parent. You then modify the ACL on the root directory. Since you've disabled...
7 Oct 2021 by Richard MacCutchan
See Introducing the PowerShell Excel Module - Scripting Blog[^].
19 Jan 2022 by Peter_in_2780
The error message is clear. The second argument (length) to Substring() is out of range, specifically it is negative. You have provided $pos as second argument, so the error message is telling you that $pos is negative at that point. You set $pos...
24 Jul 2010 by Md. Marufuzzaman
Hi Guys:I'm trying to count the Stellar process from a remote server, my code snippets is given below:function GetProcessCount($serverName){ $serviceArray = Get-WmiObject -class Win32_Service -computerName $serverName ; $Counter = 0 $serviceArray | foreach { ...
11 Apr 2011 by Richard MacCutchan
simples[^], tsk!
10 Jun 2011 by TheyCallMeMrJames
Here are some PowerShell script examples for NuGet packages
10 Sep 2011 by Richard MacCutchan
It would appear that all your SubChildNodes are being added to the first PNG node, rather than each one in turn. I have not been able to test this, but perhaps something like:$ParentNode =$file.Meta["Image"]for($j=0; $j -lt 10; $j++){ $ChildNode =...
12 Sep 2011 by Prerak Patel
http://powershell.com/cs/blogs/tips/archive/2010/04/27/finding-10-largest-files.aspx[^]http://stackoverflow.com/questions/798040/find-the-10-largest-files-within-a-directory-structure[^]http://www.christiano.ch/wordpress/2009/08/11/powershell-how-to-find-large-files/[^]
12 Sep 2011 by Prerak Patel
http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/0df70854-7bd6-4434-be0e-f75fd71daa43/[^]http://technet.microsoft.com/en-us/library/dd315304.aspx[^]
3 Oct 2011 by Sergey Alexandrovich Kryukov
Strange idea. I don't think your whole idea is really useful, but…You can create an "assembly host" .NET application which loads your assembly with functions Add, Multiply or any other, using Reflection, finds the method to be called by its full name (for example...
26 Nov 2011 by Eduard Lu
you need to install powershell 1.0 first before installing powershell 2.0. These two are different.Regards,Eduard
5 Dec 2011 by Valery Possoz
Hello,Assi...
7 Jan 2012 by Paul Jorgensen
Customizable Custom CSharp Control for the Powershell New-PSDrive cmdlet
15 Feb 2012 by Sergey Alexandrovich Kryukov
You can do it, of course, but your whole script would become "interactive" (waiting for user input) which would make it pretty much useless as such. In this case, normal windowed application could be better, as the console application with interactive input would defeat the purpose of the...
13 Apr 2012 by Vivek Krishnamurthy
Power shell build script for multiple projects and solutions using MSBuild, with an option to fix the build error during the build and continue, without restarting the complete build.
22 Feb 2013 by Bharat Nimba Pawar
importing powershell modules and executes CmdLets in windows application using Automation library APIs
10 May 2012 by Sebastian T Xavier
Hello All,I would like to know how I can execute enter-pssession command using c# code.I have used following command to run it in powershell console. $secpasswd = ConvertTo-SecureString "123$" -AsPlainText -Force $mycreds = New-object -typename...
12 May 2012 by Umer Aziz Malik
May be this might be of any help to you:After the installation of WinRM ctpv3 and powershell ctpv3 you need to reference the correct System.Management.Automation.dll.First add a reference tag from within the csproj file that you wish to use the Automation library. To do this open the...
15 May 2012 by Sandeep Mewara
This problem occurs because the handler mapping for the requested resource points to a .dll file that cannot process the request. To resolve this problem:Edit the handler mapping for the requested resource to point to the .dll file that can process the request. To do this, follow these...
15 May 2012 by Ganesan Senthilvel
Itz because ConvertToSecureString is not .NET class library, but itz PowerShell script. Just to give the background, Microsoft Windows PowerShell is a command-line shell and scripting tool based on the Microsoft .NET Framework. It is designed for system administrators, engineers and developers...
5 Jul 2012 by priypavan
Hi,I have a PS script, which will run all the cmdlets in the admin mode. I want to launch the IE in normal mode without admin previliges from the elevated mode powershell. can someone help me how to do this?thanks in advance
10 Aug 2012 by Gary Stafford
Use PowerShell 2.0 to aid in the delivery of build artifacts for release, by generating a manifest of file changes.
22 Aug 2012 by Zoltán Zörgő
Why don't you use the PowerShell class[^]? It does several things for you.By the way, you dont pass parameters as parameters. Threat runspace pipeline as a process execution. You won't add parameters to the executable name, won't you? Use the CommandParameter[^] class. See here:...
25 Aug 2012 by André Kraak
From Batch File Rename with Windows PowerShell[^]: Dir *.txt | rename-item -newname { $_.name -replace ".txt",".c" }
16 Dec 2012 by Sergey Alexandrovich Kryukov
By the way, found that Microsoft official documentation on PowerShell is prohibitively bad, even though v.3.0 is finally made well usable; and Intellisense is quite good. The best book I saw so far this one: http://www.pavleck.net/powershell-cookbook/[^].The problem with tar is: you would...
28 Dec 2012 by Sergey Alexandrovich Kryukov
As I say, writing a System.Windows.Forms application in PowerShell is quite possible.I've written this sample code write now while answering to this question. It tool me a couple of minutes. This is fully fledged minimalistic application, even with an event handler and few effects. Run it...
28 Dec 2012 by Sergey Alexandrovich Kryukov
Doing so is a bad idea. Processes are well isolated. How are you going to communicate with the script? It's much better to invoke PowerShell from your .NET application.Please see this CodeProject article:How to run PowerShell scripts from C#[^].—SA
30 Dec 2012 by Sergey Alexandrovich Kryukov
The answer depends on the type and parameter passing options for the parameters of ResourceDelegates of the function Set-CalendarProcessing, in particular, if the parameter passed from the pipeline and processed correctly. If I can assume that this parameter can accept a list of values, the call...
27 Jan 2013 by Domocos Dorel
Hello.I have a working powershell script to get the Windows product key from an machine in our network. The script runs well in powershell comand line but returns error when I try to run it from C#. I need this working to chart licenses in our corporation.Powershell code:function...
26 Apr 2013 by Zoltán Zörgő
What you are trying to run won't run in an out-of-the box powershell session. The missing cmdlet is one for the Microsoft System Center 2012 Configuration Manager SP1 console. So if you run a lecay powershell, you will have to import ConfiguratioManager module (see:...
23 Jun 2021 by Ron Anoshi
Hi,There is some code online that is supposed to do what I'm trying to do, but it didn't work for me, trying it in the PowerShell commandline line by line.I am trying to delete a certificate from the CurrentUser\My store, by its' thumbprint:Quote:get-childitem...