Click here to Skip to main content
15,884,986 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 Title

PowerShell 

4 Jan 2013 by paddy0388
I am trying to run the following script and i get an error: Exception calling "UploadFile" with "2" argument(s): "The remote server returned an error: (404) Not Found."At C:\config\ftp1.ps1:16 char:22+ $webclient.UploadFile
15 May 2012 by Sebastian T Xavier
Hello,I receive an exception while trying to use the following code. System.Uri uri = new Uri("http://My-SERVER/powershell?serializationLevel=Full");Here is the error mesaage500 - Internal server error.There is a problem with the resource you are looking for, and it cannot be...
15 May 2012 by Afzal Shaikh
Hy,The Web server is generating internal error log which can give you more details of what went wrongIt is not a client-side issue.This error can only be fix to the Web server software. Web server site operator to locate and analyse the logs which should give further information about...
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...
7 May 2014 by Member 4206974
A PowerShell 3.0 Form Generator.
4 Oct 2014 by Marco Bertschi
PowerShell is a very powerful tool, yet it's difference to the classic DOS command prompt gives you a hard time if you are used to the CMD. This article shall guide you into the World of PowerShell and give you an easy start.
17 Aug 2010 by Md. Marufuzzaman
The objective of this article (Part 2) is to introduce you to using of VB / Microsoft .NET library, Function, Methods as well in your Microsoft Windows PowerShell script.
22 Aug 2010 by Md. Marufuzzaman
The objective of this article (Part 4) is to give you an introduction on how to integrate Microsoft Windows PowerShell with the Microsoft .NET library
22 Aug 2010 by Md. Marufuzzaman
The objective of this article (Part-1) is to introduce you with Microsoft Windows PowerShell.
21 Aug 2010 by Md. Marufuzzaman
The objective of this article (Part 3) is to introduce you to Microsoft Windows PowerShell and learn some basic command of windows PowerShell.
29 Jun 2020 by Member 14874449
Walk-through and source code for an Excel VBA development workflow
16 May 2017 by Member 13007431
I am checking for antivirus name and version installed on my computer,although i have anti virus installed it is showing as "no av found"!!. Whether i need to change name to my antivirus name or we have to give "name as %antivirus% " only??? What I have tried: $avSoftware = get-wmiobject...
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...
10 Jun 2020 by Member 10014841
I am working on a multi factor authentication project - ADFS. I am trying to access authorization and token endpoint url using powershell. What I have tried: There is a command called: Get-AdfsEndPoint which retrieves a common endpoint url,...
10 Jun 2020 by Richard MacCutchan
ADFS | Microsoft Docs[^]
8 Jan 2015 by sarath.mk
Hi friends I am executing the Powershell script through C# by using WSManConnectionInfo, I am making remote connection from my local machine to Lync Server and executing the below commands.using (Pipeline pipe = remoteRunspace.CreatePipeline()) {Command...
3 Jul 2019 by Prakash Singh
Resolution of Security rule has invalid Port range issue
4 Dec 2016 by Muhammad Magdi
Step by step guide to add pre and post PowerShell scripts to TFS2012 build
25 Jul 2014 by arpoador
I need to add a method to my PowerShell script, to perform LINQ in a specific database.Should I either add a type like a class with 1 (just 1) public static method, or, can I add just 1 (just 1) static method through some specialized add type cmdlet's parameter?
10 Dec 2013 by ravi gunishetti
Adding Custom Context Menu to a Sharepoint List Using Features
28 Jun 2015 by Member 11799697
I am trying to add read-only-permissions to a specific group called "Students" for a list I have created called "Quiz". I have to use PowerShell CSOM, and in every other tutorial I've been through, .NET server types have been used.Code: $ListName = "Quiz" $PermissionLevel = "Read...
30 Apr 2012 by Luke Jefferson
Learn how to configure SMS alerts to fire based on your Windows Azure application deployment status.
18 Sep 2014 by sebastianrogers
How to add the org Chart Back into a SharePoint 2013 My Site
3 Feb 2013 by TheCodeKing
This article provides a solution for deploying multiple applications to a single AWS instance when using AWSDeploy.
4 Oct 2016 by Shawn K Lewis
Powershell script for Amazon Dash button Detection via DHCP Discover message
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
12 Nov 2018 by Tushar_Gupta
Quick Start tutorial for creating AngularJS applications
1 Oct 2021 by Empty Coder
Hi All Below is the existing data I have in my csv file "Server","Disk ###","Status","Size","Free" "s1","Disk 0","Online","100 GB","1024 KB" "s1","Disk 1","Online","6144 MB","1024 KB" "s1","Disk 2","Online","200 GB","1024 KB" "s1","Disk...
9 Aug 2018 by Zachary.shupp
I have been working on an xml structure and Im having issues adding to a specifc part of the XML file and need help. My goal is to add new category under the Categories node. below is my current code.$Path = "C:\Users\shuppz\Desktop\XML\Helpbox.xml"$xmlDoc =...
16 Nov 2013 by Zoltán Zörgő
Could you post a sample XML file?I don't think you can address the node like this: ".AdminLauncher.Categories", you have to select it to be able to add a child node.Something like this:$newCat =...
27 Jan 2019 by Melick
How to resolve the issue: AppFabric installation failed because installer MSI returned with error code: 1603
16 Sep 2020 by Member 4206974
A function that works on event of Arduino and ESP32 boards
9 Feb 2020 by OwenDavies
Fix for persistent issue with "reboot node if needed"
18 Feb 2020 by OwenDavies
Microsoft announced back in May of the Windows Server Containers support in Azure Kubernetes Service Preview. Finally we can run Windows containers on the AKS service. It’s still only in preview, but fingers crossed will be coming to General Availability soon..
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.
9 Feb 2020 by OwenDavies
So you want to create a Virtual Machine on Azure, this can be done in the portal. But really we want this scriptable, so that we can run it at a later date if needed and also so we can leverage this work and use it to create other virtual machines at a later date..
9 Feb 2020 by OwenDavies
How to non-interactively login to Azure with PowerShell
15 Nov 2012 by Krishnamurthy M
Hi all,I want to configure IP to the new VM using powershell.the hyper-v server can be win2k8 R2 or 2012.The VM has OS and switch.Please let me know the powershell commands for this.
30 Aug 2018 by KD209
Hello All, I am trying to create a PS Script that will search AD account with the following conditions: Account is Active/Enabled (account not disabled) Account is expired 90 days or more Account password is not set to never expire or Account password has expired I want the result to return...
21 Sep 2018 by Richard Deeming
Try PasswordLastSet instead of PwdLastSet. As far as I can see, there isn't a PwdAge property; you'll need to calculate it from the PasswordLastSet property. Something like this should work: Search-ADAccount -AccountInactive -TimeSpan 90 -UsersOnly -SearchBase "OU=User...
30 Oct 2013 by Manoj.Kumar12
Authentication against CRM contact using custom STS
19 Mar 2020 by Member 14637786
Is it possible to access devops repo within powershell script using managed identity without any manual steps like interactive login (this has to run automatically as azure function)? The goal is to attach a master branch to appservice but this...
16 Sep 2013 by Durgesh Nakkani
Hi,I had posted as article/Tip a AutoBuild Installer - Durgesh Nakkani, however I am unable to download those scripts/files and even others as well.I am not sure if this this is the right place to take it up.Please have a look at it and please let me know if I can upload them...
16 Sep 2013 by Richard MacCutchan
No this is the wrong place, use the Article Writing forum.
6 Nov 2013 by Maximus5
Creating new release and uploading release files in one click
17 Sep 2013 by Durgesh Nakkani
This tool copies MSI installers from a distributed server and installs it on a VM Wrokstation
1 Apr 2018 by JavaScrptMaster
I am trying to write a Power Shell script which will check the connection status of paired Bluetooth devices in a certain interval (15 sec) and if found the device is out of range then will lock the users system. What I have tried: In the following code I am not able to figure out how to list...
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.
25 Jan 2011 by Yogesh M Joshi
This article demonstrates the use of PowerShell script to publish contents on SharePoint site
14 Jun 2023 by Leszek Koc
Auto subscription of Azure functions to Event Grid
28 Aug 2015 by Daniel Vaughan
When submitting a UWP or WinRT app to the Windows Store, you must increase the Version number of the package or the submission will fail. It can be a chore to manually update the version number.
14 Aug 2012 by Gary Stafford
Automate the creation of Task-type Work Items in TFS using PowerShell
2 Feb 2014 by TheCodeKing
This article focuses on an alternative way to deploy and update .NET applications running on AWS EC2 instances, and mitigates the shortcomings of the AWSDeploy standalone tool.
25 Jan 2024 by Wessel Beulink
Azure spearheads cloud evolution, Azure Automation Runbooks manage hybrid/SOC environments effectively
31 Jul 2017 by Passion4Code
Azure automation using Powershell
8 Dec 2020 by Maximilien
I have a simple test release pipeline with 2 stages with 1 powershell task in each stage. reference: Define variables - Azure Pipelines | Microsoft Docs[^] 1st stage: I want to set a variable value, from what I understand I have to use this...
8 Dec 2020 by Sander Rossel
In the second stage, it would suffice to just say: Write-Host 'reference: $(MyOutputVariable)' Since MyOutputVariable is the name of your variable and it is literally inserted where you place it, so inside the quotes. I'm not sure where...
11 Jul 2011 by Atique Rahman
An article describing some of the tricks of PowerShell scripts and profile that enables you to get a bash like prompt in PowerShell and run applications more flexibly.
16 Sep 2021 by Fringe Coder
How to uninstall multiple devices at once using PowerShell ISE
31 May 2019 by getrelax
I want to breakdown an xml document into two. This is basically by accessing the second xml file as external entity. Originally the full document looks as follows: Tove Jani Reminder ...
27 Apr 2014 by awilson9010
Building WinPEs from AIK/ADK with Powershell
19 Oct 2016 by Atish Dipongkor
Writing CAML queries in a optimized, efficient and easiest way.
8 Jan 2018 by Ehsan Sajjad
This is a step by step guide for beginner on how to install .NET Core 2.0 and create a Console Application without any IDE using Command Prompt/PowerShell
15 Oct 2018 by Patrick Skelton
I have what I thought would be a dead easy question to find an answer to. Having really, really tried to get on with PowerShell, I find its syntax to be arcane to say the least. I don't doubt its power but I'm not a sysadmin and I don't do batch scripting very often. So every time I come back...
15 Oct 2018 by #realJSOP
This CP article might help: Compiling C# Code at Runtime[^] You could essentially create a CSharpScript app that loads a text file that contains C# "script" code and compile that script at runtime. You could also write pre-compiled plugins for your script runner app, and specify the DLL...
16 Apr 2014 by Kinna-10626331
Hi , I'm trying to execute C# code in Power Shell 2.0 .My problem is for the references at the beginning of the code:$code = @"using System;using System.Collections;using System.IO;using System.Linq;using System.Xml;using System.Xml.Linq; public class...
21 Mar 2014 by notjustme
You're not providing a whole lot of information. What errors are you seeing?Anywho, try this for your Add-Type line and see how far that takes ya:Add-Type -TypeDefinition $source -Language CSharp -ReferencedAssemblies System.Xml, System.Xml.Linq
17 Apr 2014 by Kinna-10626331
Hi , I'm trying to execute C# code in Power Shell 2.0 .My problem is for the references at the beginning of the code:$referencingassemblies =...
17 Apr 2014 by Sergey Alexandrovich Kryukov
I don't know such namespace. Here is the thing: Power Shell is the interpretive system; and you need to loads some additional assembly which is not loaded by default. As everything in interpretive system, it needs to be loaded "during runtime", dynamically. How? I'll demonstrate how to load an...
1 Aug 2014 by arpoador
PowerShell gives you the correct error message: namespace System.Xml.Linq does not exist.PowerShell v2 uses CLR 2.0, and System.Xml.Linq is not part of it yet.Update to PS v4, it uses CLR v4.0, which has that namespace.
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.
18 Nov 2010 by steetaylor20
I want to run the following in a c# loop but I just don't know how to pass a multi value for a parameter with a comma. The actual cmdlet would be below and does work in exchange powershell:Set-CalendarProcessing –ResourceDelegates jonDoe@test.com,johnnydoe@test.com -identity...
18 Nov 2010 by Dave Kreskowiak
I haven't tried it, but putting quotes around the parameter with the comma in it may work.Set-CalendarProcessing –ResourceDelegates "jonDoe@test.com,johnnydoe@test.com" -identity testroom@test.com –AutomateProcessing AutoUpdateIt's a thought, but entirely untested.
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...
22 Oct 2013 by JD86
I've created a project that manages Active Directory and Exchange. Right now each command is opening a new runspace for remote powershell and each command that talks to Active Directory is opening a new connection as well. So when it is finished it will close the connection and properly dispose...
31 Mar 2015 by Member 10726551
I only have a basic understanding of the C# language but I am troubled, my program uses Powershell to perform tasks.My specific problem is I am unable to attach an another event handler which can listen for a key press after the user has clicked a button, I'll explain.1. User clicks...
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 Feb 2018 by Sacha Barber
The Cake build tool is a build tool that utilizes the Roslyn (compiler as a service) from .NET.
3 Feb 2022 by JRivord
I have a script that is using PowerShell 5.1 and calling New-WebServiceProxy. I want to make this work in PowerShell Core (7.1). I have spent several hours trying to resolve this issue. Some of the best places I have found are...
6 Nov 2020 by pkfox
Hi all, I am trying to make a call to an API protected with a Azure AD token from Powershell $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" $Token = Get-AzCachedAccessToken $headers.Add("Authorization",$Token) ...
6 Nov 2020 by RickZeeland
Could be a permissions issue, see: Using powershell to connect to azure ad using access token - Stack Overflow[^]
6 Nov 2020 by pkfox
Hi Rick thanks for replying - I don't think it's security on Azure as I can get a token without any errors it's the call to the API that errors - I think the token is not arriving or something along those lines
17 Apr 2012 by Zac Newman
Heya Guys, I am trying to connect to a wsman service in VB.Net to admin some exchange accounts. The code I have to perform the connection and make the changes are as follows Const SHELL_URI As String = "http://schemas.microsoft.com/powershell/Microsoft.PowerShell" ...
21 Mar 2013 by Purish Dwivedi
I am getting below mentioned error while executing the bold part in the script. Please help me to resolve this.A positional parameter cannot be found that accepts argument '-DisplayName'. + CategoryInfo : InvalidArgument: (:) [Set-MailContact], ParameterBindingException +...
22 Jan 2013 by garfield185
Hello everybody.I am trying to create a regular web part page with powershell and I am not able to do it. There is no information in google about the error I get:$spWeb = Get-SPWeb -Identity "http://server/site"$pubWeb...
26 May 2016 by Black_Rose
Hi allI have a hidden folder at my C:\.I want to change the folder attribute to ReadOnly.Please help me on this.What I have tried:Set-ItemProperty -Path "$Directory_Path$Directory" -Name attributes -Value ((Get-ItemProperty "$Directory_Path$Directory").attributes -bxor...
26 May 2016 by Richard MacCutchan
See Hey, Scripting Guy! Weekend Scripter: Enumerations and Values | Hey, Scripting Guy! Blog[^], that should help you debug your issue.
30 Nov 2012 by TexaWeb
How to change the name of a SharePoint site in URL
26 Jun 2018 by TarunShrivastav
Hi for a Software prerequisite check I need to check .Net 3.5 and .Net 4.5 framework and feature. for Checking 3.5 I am using Below powershell command Get-WindowsFeature | ? {$_.Name -eq 'NET-Framework-Core'} | ForEach-Object {$_.Installed} And For checking 4.5 I am using ...
23 Jun 2018 by Gerry Schmitz
Check the install folders: C:\Windows\Microsoft.NET\Framework
26 Jun 2018 by Richard Deeming
The registry seems to be the right way to go: How to: Determine which .NET Framework versions are installed | Microsoft Docs[^]
14 Aug 2012 by priypavan
Hi,Can someone help me on how to check and install the Windows Updates(WU) forcibly on my local machine? I tried the below but no luck.$key = @{ Path = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate\AU' Name =...
31 Aug 2012 by Zoltán Zörgő
Here is are two tutorials about how you can access the AutoUpdate object from...
9 Feb 2015 by SachinSutar
HI..I'm trying checkin files on Team Foundation Server using TF Checkin command.(changes done on local workspace)tf checkin “$/PredictiveDialer/ApplicationCompiler/ApplicationCompiler/Properties/AssemblyInfo.cs” /comment:"Version Update"Even in Assembly file version is increment...
22 Apr 2015 by zerocool18
You can run "tf status" command first.It'll show you list of pending changes.Check if your file is there.PS : You need to change directory to your mapped folder first.Example, if your local mapped folder is "E:\TFSFiles".Then, 1. cd E:\TFSFiles 2. tf.exe status
22 Mar 2020 by OwenDavies
A quick look at what is Chocolatey and how to install it