Click here to Skip to main content
14,972,848 members
Everything / Programming Languages / PowerShell

PowerShell

PowerShell

Great Reads

by Daniel Miller
This article describes the C# implementation for a high-performance user/role security principal hierarchy.
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 Christian Vos
How to use Microsoft Unity Interception as a solution for cross cutting concerns in a .NET application
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.

Latest Articles

by Aditya-Sharma0712
How to set classification label to an Excel/Word/PDF file at the time of its creation during runtime programmatically
by wkiess01
A Powershell script to rename HD video camera files using their original creation date
by Benktesh Sharma
How to create, modify and update Docker image from container
by Marijan Nikic
A simple solution using Powershell for preparing emails from Windows batch in Outlook; supports HTML body

All Articles

Sort by Score

PowerShell 

Please Sign up or sign in to vote.
5 Dec 2015
Daniel Miller
This article describes the C# implementation for a high-performance user/role security principal hierarchy.
Please Sign up or sign in to vote.
6 Jan 2020
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.
Please Sign up or sign in to vote.
27 Nov 2015
Christian Vos
How to use Microsoft Unity Interception as a solution for cross cutting concerns in a .NET application
Please Sign up or sign in to vote.
8 Aug 2017
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.
Please Sign up or sign in to vote.
17 Nov 2017
Daniele Fontani
A powershell script that monitors webs sites and trace logs into database.
Please Sign up or sign in to vote.
15 Apr 2020
Издислав Издиславов
This article will demo the usage of Blazor WebAssembly and how to create simple web application with it.
Please Sign up or sign in to vote.
12 Apr 2015
Shining Dragon
A look into how we can achieve multi threading in our Powershell scripts
Please Sign up or sign in to vote.
1 Sep 2018
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
Please Sign up or sign in to vote.
30 Apr 2012
Luke Jefferson
Learn how to configure SMS alerts to fire based on your Windows Azure application deployment status.
Please Sign up or sign in to vote.
14 Jan 2020
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.
Please Sign up or sign in to vote.
1 Nov 2020
awilson9010
Working with Windows BCD store in Powershell
Please Sign up or sign in to vote.
15 Sep 2018
Bogdan Marian
Ensure your Docker Compose services start in the correct order.
Please Sign up or sign in to vote.
21 Feb 2012
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...
Please Sign up or sign in to vote.
17 May 2016
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.
Please Sign up or sign in to vote.
11 Jul 2016
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.
Please Sign up or sign in to vote.
16 Aug 2010
shappell
A Script for determing the levenshtein distance between two strings in PowerShell
Please Sign up or sign in to vote.
20 Sep 2010
Ali BaderEddin
Restore an SQL database on a local or remote SQL server using PowerShell
Please Sign up or sign in to vote.
17 Aug 2011
Milind R Chavan
Create MySQL Database backup using mysqldump
Please Sign up or sign in to vote.
10 Jul 2014
RoboJRR
How to use Powershell to query webservices.
Please Sign up or sign in to vote.
28 Oct 2014
Sacha Barber
PowerShell: Create MSMQ
Please Sign up or sign in to vote.
29 Oct 2014
Mohamed Meligy
How to use Visual Studio developer command prompt with Powershell
Please Sign up or sign in to vote.
24 Nov 2014
Sacha Barber
How to use PowerShell to carry out REST operations such as GET/POST
Please Sign up or sign in to vote.
14 Dec 2015
Member 12014821
PowerShell for Office 365
Please Sign up or sign in to vote.
22 Dec 2015
2irfanshaikh
Use SharePoint Commandlets in Windows PowerShell ISE
Please Sign up or sign in to vote.
9 Jan 2017
dandy72
Copy removable media more quickly by eliminating all the usual repetitive application interaction steps you normally have to go through.
Please Sign up or sign in to vote.
18 Oct 2020
Mohssine EL HARFI
ECLP in C#
Please Sign up or sign in to vote.
22 Dec 2020
Marijan Nikic
A simple solution using Powershell for preparing emails from Windows batch in Outlook; supports HTML body
Please Sign up or sign in to vote.
20 Sep 2010
Uros Calakovic
I encountered a problem while trying to use WPF UI Automation with PowerShell - PowerShell reported incorrect type for automation elements
Please Sign up or sign in to vote.
10 Feb 2011
Nish Nishant
Typically this is done through named arguments. Example:filename:abc.txt color:redNow the order of the parameters don't matter.
Please Sign up or sign in to vote.
3 Oct 2011
Espen Harlinn
This is one of the really good articles on the subject:Extend Windows PowerShell With Custom Commands[^]Best regardsEspen Harlinn
Please Sign up or sign in to vote.
24 Oct 2011
manibe2k5
This article will assist you to deliver/deploy your Sharepoint site and its features using Powershell
Please Sign up or sign in to vote.
19 Dec 2012
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...
Please Sign up or sign in to vote.
19 Dec 2012
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...
Please Sign up or sign in to vote.
30 Oct 2013
Manoj.Kumar12
Authentication against CRM contact using custom STS
Please Sign up or sign in to vote.
2 Mar 2014
Matthias Kainer
Registering your powershell modules on demand with PSReg
Please Sign up or sign in to vote.
26 Nov 2014
Zhuyun Dai
Describes how to resolve the 'Double-Hop' issue in PowerShell remoting and how to troubleshoot issues we may meet.
Please Sign up or sign in to vote.
31 Mar 2015
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...
Please Sign up or sign in to vote.
20 May 2015
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
Please Sign up or sign in to vote.
4 Jun 2015
Sacha Barber
Powershell: Get process stats
Please Sign up or sign in to vote.
30 Nov 2015
Sarkis Matossian
Encoding a .NET assembly as a hex string to install in SQL Server.
Please Sign up or sign in to vote.
29 Jul 2015
LalithGallage
This powershell script is you to monitor windows servers’ free hard disk and populate it to sharepoint custom list.
Please Sign up or sign in to vote.
6 Dec 2015
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
Please Sign up or sign in to vote.
19 Dec 2015
dineshiam
This tip will give an overview to Sitecore developer about how to migrate data using Sitecore PowerShell scripts.
Please Sign up or sign in to vote.
9 Feb 2016
Jim Roth
Use PowerShell Post-build scripts to check in binaries to TFS for continuous integration during the build process.
Please Sign up or sign in to vote.
1 Mar 2016
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...
Please Sign up or sign in to vote.
17 May 2016
MarkHawes
Ugh, WIFI not working or unstable? Try this tip....
Please Sign up or sign in to vote.
4 Oct 2016
Shawn K Lewis
Powershell script for Amazon Dash button Detection via DHCP Discover message
Please Sign up or sign in to vote.
28 Nov 2016
Sujay Sarma
PowerShell script to split single-file routines export from MySQL Server
Please Sign up or sign in to vote.
6 May 2017
Tibor Blazko
Example usage of The Old Reader's and Inoreader's APIs
Please Sign up or sign in to vote.
8 Dec 2016
Sujay Sarma
PowerShell Script to Automate Hyper V Snapshots
Please Sign up or sign in to vote.
8 Dec 2016
Sujay Sarma
Here is a script to create an event source using PowerShell
Please Sign up or sign in to vote.
17 May 2017
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...
Please Sign up or sign in to vote.
30 Apr 2018
Ryan G Conrad
Using Powershell and Windows Task Scheduler API to detect malicious login attempts on a remotely accessible SQL Server database
Please Sign up or sign in to vote.
28 Jun 2018
RamanaReddy V
Login to your VPN through CISCO with single mouse click jump to your VPN system below 30 seconds..!
Please Sign up or sign in to vote.
31 Dec 2018
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.
Please Sign up or sign in to vote.
21 May 2019
Tom Ling
How to export VS code extensions to another computer using PowerShell
Please Sign up or sign in to vote.
20 Nov 2019
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.
Please Sign up or sign in to vote.
12 Mar 2020
Kevin Mack
What kinds of things should I avoid, or remove from my applications to improve my position moving forward
Please Sign up or sign in to vote.
29 Jun 2020
Member 14874449
Walk-through and source code for a excel VBA development workflow
Please Sign up or sign in to vote.
20 Jun 2021
Aditya-Sharma0712
How to set classification label to an Excel/Word/PDF file at the time of its creation during runtime programmatically
Please Sign up or sign in to vote.
24 Jul 2010
Md. Marufuzzaman
1 alternative  
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 { ...
Please Sign up or sign in to vote.
11 Apr 2011
Richard MacCutchan
simples[^], tsk!
Please Sign up or sign in to vote.
10 Jun 2011
TheyCallMeMrJames
Here are some PowerShell script examples for NuGet packages
Please Sign up or sign in to vote.
10 Sep 2011
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 =...
Please Sign up or sign in to vote.
12 Sep 2011
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/[^]
Please Sign up or sign in to vote.
12 Sep 2011
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[^]
Please Sign up or sign in to vote.
3 Oct 2011
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...
Please Sign up or sign in to vote.
26 Nov 2011
Eduard Lu
you need to install powershell 1.0 first before installing powershell 2.0. These two are different.Regards,Eduard
Please Sign up or sign in to vote.
5 Dec 2011
Valery Possoz
Hello,Assi...
Please Sign up or sign in to vote.
15 Feb 2012
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...
Please Sign up or sign in to vote.
13 Apr 2012
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.
Please Sign up or sign in to vote.
22 Feb 2013
Bharat Nimba Pawar
importing powershell modules and executes CmdLets in windows application using Automation library APIs
Please Sign up or sign in to vote.
10 May 2012
Sebastian T Xavier
1 alternative  
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...
Please Sign up or sign in to vote.
12 May 2012
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...
Please Sign up or sign in to vote.
15 May 2012
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...
Please Sign up or sign in to vote.
15 May 2012
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...
Please Sign up or sign in to vote.
5 Jul 2012
priypavan
2 alternatives  
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
Please Sign up or sign in to vote.
10 Aug 2012
Gary Stafford
Use PowerShell 2.0 to aid in the delivery of build artifacts for release, by generating a manifest of file changes.
Please Sign up or sign in to vote.
22 Aug 2012
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:...
Please Sign up or sign in to vote.
25 Aug 2012
André Kraak
From Batch File Rename with Windows PowerShell[^]: Dir *.txt | rename-item -newname { $_.name -replace ".txt",".c" }
Please Sign up or sign in to vote.
16 Dec 2012
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...
Please Sign up or sign in to vote.
28 Dec 2012
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...
Please Sign up or sign in to vote.
28 Dec 2012
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
Please Sign up or sign in to vote.
30 Dec 2012
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...
Please Sign up or sign in to vote.
27 Jan 2013
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...
Please Sign up or sign in to vote.
26 Apr 2013
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:...
Please Sign up or sign in to vote.
25 Jun 2013
Prasad_Kulkarni
Refer: Folder Path of Powershell file In Powershell[^]Also refer similar 3,340,000 threads on simple search here[^]
Please Sign up or sign in to vote.
24 Sep 2013
Member 10294688
2 alternatives  
I have written a program in VB.NET VS2010 that will submit mailbox extract requests to an Exchange 2010 environment. It presents a status list view that shows submitted, queued, in progress, complete, and erred mailboxes. All of the Powershell commands are submitted synchronously.When you...
Please Sign up or sign in to vote.
14 Nov 2013
Sergey Alexandrovich Kryukov
In your sample, nothing creates event arguments. Usually it is done in the class declaring some event, when you invoke the event (.NET allows to invoke events only in the classes declaring corresponding event instance nowhere else), but you can only create "real" .NET classes in PowerShell if...
Please Sign up or sign in to vote.
16 Nov 2013
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 =...
Please Sign up or sign in to vote.
7 May 2014
Member 4206974
A PowerShell 3.0 Form Generator.
Please Sign up or sign in to vote.
11 Jul 2014
MANPREET SINGH
How to read XML files and add them into SharePoint 2010 through Powershell
Please Sign up or sign in to vote.
28 Jul 2014
Muhammad Muddasar Yamin
The article is about launching elevated processes through command line
Please Sign up or sign in to vote.
8 Sep 2014
_Asif_
Check this!Reading Device Manager's Property Fields in Windows 7/8[^]
Please Sign up or sign in to vote.
10 Sep 2014
Jhony_Bravo
In Power Shell :$computer = "LocalHost" $namespace = "root\CIMV2" Get-WmiObject -class Win32_PnPEntity -computername $computer -namespace $namespace | Where{$_.ConfigManagerErrorCode -gt 0} | FT Name, ConfigManagerErrorCode,Status
Please Sign up or sign in to vote.
22 Oct 2014
Sacha Barber
Powershell selecting from SQL Server
Please Sign up or sign in to vote.
14 Nov 2014
Bryan O'Connell
Write a functional test script for a REST API using PowerShell.
Please Sign up or sign in to vote.
2 Dec 2014
OriginalGriff
It doesn't quite work like that.We do not do your work for you.If you want someone to write your code, you have to pay - I suggest you go to Freelancer.com and ask there.But be aware: you get what you pay for. Pay peanuts, get monkeys.
Please Sign up or sign in to vote.
10 Apr 2015
Maciej Los
Follow this:Using the Copy-Item Cmdlet [^]Copy-item Files in Folders and subfolders in the same directory structure of source server using Powershell[^]
Please Sign up or sign in to vote.
10 Apr 2015
Sergey Alexandrovich Kryukov
Creating multiple copies of the same file sounds like a bad technology abuse.In worst case, when some ill-organized structure really needs such multiple copies (one typical application are C/C++ header files used in different places of code), it could be much more appropriate to create POSIX...
Please Sign up or sign in to vote.
15 Jul 2015
Dave Benham
It is true there is nothing built into the primitive batch language that even comes close to exception handling. Never-the-less, there is a surprisingly sophisticated and robust implementation of batch exception handling posted at http://www.dostips.com/forum/viewtopic.php?f=3&t=6497, and it...
Please Sign up or sign in to vote.
18 Aug 2015
nirman b doshi
PowerShell scripts to apply configuration transformations for App.Config or Web.Config files
Please Sign up or sign in to vote.
25 Oct 2015
Patrice T
$A = get-content -path $filePath | select -first 3 -last 1The problem is that you read the entire file and then transmit it to select via a pipe(|).Should certainly be better to do somothing like$A = get-content -path $filePath -head 3;get-content -path $filePath -tail 1This way,...
Please Sign up or sign in to vote.
10 Jan 2016
skydger
Critical Error – Start Menu and Cortana aren’t working
Please Sign up or sign in to vote.
10 Feb 2016
Richard MacCutchan
See Using the Add-Content Cmdlet[^].
Please Sign up or sign in to vote.
1 May 2016
Richard MacCutchan
See Powershell function return string - Google Search[^].
Please Sign up or sign in to vote.
4 May 2016
Dave Kreskowiak
Select-String didn't show up in PowerShell until version 3.0. You're probably running an earlier version of PowerShell.Update the version of PowerShell on the machine and you should be good to go.
Please Sign up or sign in to vote.
26 May 2016
Richard MacCutchan
See Hey, Scripting Guy! Weekend Scripter: Enumerations and Values | Hey, Scripting Guy! Blog[^], that should help you debug your issue.
Please Sign up or sign in to vote.
9 Jun 2016
Member 12575030
1 alternative  
I have an XML document that describes requirements. If I had Powershell code between the Values tag, could I somehow extract it and then run it? TRUE Three letter country code where the individual receives company...
Please Sign up or sign in to vote.
9 Jun 2016
Sergey Alexandrovich Kryukov
You have to achieve two different things: 1) parse XML in PowerShell, 2) when you extract some parameters and extract/compose a PowerShell command, execute this command.To start with, read this short but instructional article: Using PowerShell to read xml-files | Little more than out of the...
Please Sign up or sign in to vote.
29 Sep 2016
Maciej Los
Check this:Script Get files older than a specified time period PowerShell[^]Delete files older than x-days - Cleanup Script[^]Delete files older than 15 days using PowerShell - Stack Overflow[^]And change to your needs ;)
Please Sign up or sign in to vote.
4 Dec 2016
Muhammad Magdi
Step by step guide to add pre and post PowerShell scripts to TFS2012 build
Please Sign up or sign in to vote.
8 Feb 2017
DanielBrownAU
$list.Items should be $MyList.Items as you do not have a declaration for $list.Also, I would check $web.Lists["CareTeam Application"], This may also cause issuesAs a safer option, I would use the ListID/GUID of the list.To obtain the list ID, just goto the settings page of the list...
Please Sign up or sign in to vote.
31 May 2017
Maciej Los
Your data are not in csv format. These data are in JSON format. I'd sugges to read this: VBA - GitHub - VBA-tools/VBA-JSON: JSON conversion and parsing for VBA[^] and Parsing JSON in Excel VBA - Stack Overflow[^] VBScript - JSON Encoder for VBScript · GitHub[^] and Decode/Encode JSON with...
Please Sign up or sign in to vote.
31 Jul 2017
Passion4Code
Azure automation using Powershell
Please Sign up or sign in to vote.
22 Jan 2018
Jochen Arndt
The system where you enter Invoke-Command -ComputerName is a client and the remote systems passed as arguments are servers here. So you have to execute Enable-PSRemoting on the remote systems and not on yours: Enable-PSRemoting[^]: You have to run this command only one time on each computer...
Please Sign up or sign in to vote.
2 Apr 2018
Christiaan van Bergen
For years I have worked with Inno Setup, this might just fit your needs.
Please Sign up or sign in to vote.
23 Jul 2018
Richard Deeming
Annoyingly, the DirectoryName property doesn't seem to work when you're sorting the results. Neither does the Parent property. You'll probably need to use Select-Object to add a computed property to the list: $deleteFolderList = Get-ChildItem -Path $rootFolder -Recurse -Directory -Include (...
Please Sign up or sign in to vote.
21 Sep 2018
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...
Please Sign up or sign in to vote.
19 Nov 2018
Leszek Koc
Automatic subscription of Azure functions to Event Grid
Please Sign up or sign in to vote.
21 Mar 2019
Maciej Los
Please, follow this: Use PowerShell to Work with Any INI File | Scripting[^] These might be helpful too: MartijnBrant.net » Blog Archive » Reading / parsing / writing .ini files in Powershell using XML[^] Handling ini files in PowerShell[^]
Please Sign up or sign in to vote.
8 Feb 2020
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.
Please Sign up or sign in to vote.
9 Feb 2020
OwenDavies
A year ago in this post we created an Azure Virtual Machine using PowerShell instead of using the Azure Portal. This is fairly simple and allows a level of automation.
Please Sign up or sign in to vote.
11 Feb 2020
OwenDavies
The IIS rewrite module is a really powerful feature in IIS. It gives you power to set up rules to handle how requests for specific URLs are handled.
Please Sign up or sign in to vote.
19 Feb 2020
Josef Zdráhal
What's wrong on changing environment variables using Environment provider like $env:variableName = ? (see about_Environment_Variables - PowerShell | Microsoft Docs[^]: When you change environment variables in PowerShell, the...
Please Sign up or sign in to vote.
28 Feb 2020
OwenDavies
Using Terraform to create an Azure Virtual Machine
Please Sign up or sign in to vote.
24 Nov 2020
Richard Deeming
An extra Get-ChildItem / ForEach-Object should work, with an added Test-Path to exclude folders which don't exist: $source = 'C:\Program Files\Mozilla Firefox\plugins\plugin.xpi' Get-ChildItem "C:\Users" -Directory | Where-Object { Test-Path...
Please Sign up or sign in to vote.
26 Nov 2020
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.
Please Sign up or sign in to vote.
4 Feb 2021
Richard Deeming
Install Azure PowerShell on Windows with PowerShellGet | Microsoft Docs[^]: The module described in this document, AzureRM, uses .NET Framework. This makes it incompatible with PowerShell 6.0, which uses .NET Core. If you are using PowerShell...
Please Sign up or sign in to vote.
13 Aug 2018
Rajneesh Kumar Verma
How to reset username and password of IIS Server Application Pool
Please Sign up or sign in to vote.
23 Jun 2021
Ron Anoshi
4 alternatives  
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...
Please Sign up or sign in to vote.
24 Jul 2010
Santiago Sanchez
As far as I know, you will need to have Administration rights in the remote machine.Try to do the following.1.Create your user in the remote machine with admin rights2.Try againHope it helps.
Please Sign up or sign in to vote.
18 Dec 2012
Andreas Gieriet
3 alternatives  
So far I was using cygwin for my well known Unix scribbles to achieve some quick results on file system and file content manipulations.Since a while, I consider migrating to a pure Windows environment for such tasks. Currently, I'm struggling with the following Bash command line (is there a...
Please Sign up or sign in to vote.
18 Nov 2010
steetaylor20
2 alternatives  
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...
Please Sign up or sign in to vote.
7 Dec 2010
sachidanandgowda
1 alternative  
I am new to powershell and was curious to try out new things.I wanted to get IIS 7.5 details from powershell like the ones that are mentioned below, and I wanted their values. For example : while I worked with the MSSQL , I used to get various properties details associated with each...
Please Sign up or sign in to vote.
7 Dec 2010
Richard MacCutchan
Take a look at some of these[^] links.
Please Sign up or sign in to vote.
11 Feb 2011
Vipin Kumar Mallaya G
1 alternative  
I am creating a cmdlet with three parameters. The first and third items are mandatory whereas the second item is not mandatory. I cannot chage the position of these parameters. How can I make it happen? I need help with this situation.I am new to cmdlets.Thank in advance. Regards...
Please Sign up or sign in to vote.
17 May 2011
Omar Al Zabir
Files with different date time get different ETag generated by IIS. As a result, on a web server farm, each webserver sends different ETag for the same file as the files are copied to those servers at different date time. Here's a script that can set date time of same file across multiple servers to
Please Sign up or sign in to vote.
20 Jun 2011
deepthakannan
4 alternatives  
This is my Script file. It displays all the arguments that are passed to it and their count.ScriptwithArguments.ps1========================Arguments: $($args.count)$argsI'm trying to run this script from C# Process.Start()If I say...
Please Sign up or sign in to vote.
22 Jun 2011
deepthakannan
I haven't tried Alan's suggestion. But I found a way to make this work. Process.Start(@"path\to\Powershell.exe", @""" 'ScriptwithArguments.ps1' 'arg with space' 'more args' """);
Please Sign up or sign in to vote.
27 Jun 2011
Madhusudan Nagaraja
Hi, I have listed below sample code through which am trying to acheive Multilevel calling of Powescript files Batch file.SingleLevel.ps1function SingleLevel{ Write "This function is called directly from the batch file" MultiLevel}MultiLevel.ps1fucntion MultiLevel{ ...
Please Sign up or sign in to vote.
27 Aug 2011
theit8514
TaskList shows incorrect data - Use PowerShell instead
Please Sign up or sign in to vote.
11 Jul 2011
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.
Please Sign up or sign in to vote.
22 Jul 2011
TheCodeKing
Windows Remoting works perfectly for same domain situations, but has some gotchas in mixed domain scenarios.
Please Sign up or sign in to vote.
28 Jul 2011
Steve Psaltis
Extract variables from a persisted workflow to debug an issue or to verify your persistence
Please Sign up or sign in to vote.
8 Aug 2011
Esteban Alvarez
How to generate entity classes dynamically in your build processes using PowerShell scripts
Please Sign up or sign in to vote.
4 Aug 2011
deepthakannan
Hello Friends, I'm trying to run a bunch of powershell script files one by one through a c# winform application using Process.Start(). Whenever I start a powershell for a scriptfile, it creates a new Powershell Process and runs a script file.The problem with this is that, i'm...
Please Sign up or sign in to vote.
5 Aug 2011
deepthakannan
2 alternatives  
I'm using Process.Start() to start Powershell to execute a script. I would like to run multiple script files one after the other in the same Powershell Window so that they all have the same session.Please let me know if there is a way to achieve this .Thanks in Advance !
Please Sign up or sign in to vote.
5 Aug 2011
Reiss
Good suggestion from digimanus - you could even be a bit smarter and create the controller script on the fly.
Please Sign up or sign in to vote.
6 Aug 2011
Richard MacCutchan
See here[^]; I don't know what your problem is, but a Google search should always be your first step in cases like this.
Please Sign up or sign in to vote.
23 Aug 2011
priypavan
1 alternative  
I have a folder conatins few images(.png files), one xsl file which is linked in xml file and few URLs which are present in xsl, and a xml file. Could anyone please let me know how to create mhtm file using the xml file using powershell or .net or vb script? output: *The mhtm page should be...
Please Sign up or sign in to vote.
23 Aug 2011
GenJerDan
This will probably help: Convert HTML to MHTML using ASP.NET[^]
Please Sign up or sign in to vote.
10 Sep 2011
priypavan
2 alternatives  
here is the hierarchy that need to create in XMLExample:MyFile- my current implementation:[xml] $file = Get-content C:\MyFile.xml$Parent...
Please Sign up or sign in to vote.
10 Sep 2011
priypavan
1 alternative  
When i execute the below statments, i can see the directory path [array]$PNGsDirectory = Get-ChildItem C:\FileName\ *.png -recurse | Select-Object Directoryfor($j=0; $j -lt $PNGfiles.Count; $j++) {Write-Host...
Please Sign up or sign in to vote.
18 Sep 2011
priypavan
Hi,I have a mhtml file as test.mhtdata present in test.mht is as belowField String Name Carpool Type ModernApplication Language en-us English Category Tools IsTrial false GUID 712ec8b1-0370-4ed5-b1ac-f0eca1f64348 MarketsMarketName United States ...
Please Sign up or sign in to vote.
18 Sep 2011
Agecanonix
Not entirely sure what you are trying to achieve, but try something like this:[array]$PNGsDirectory = Get-ChildItem C:\FileName\ *.png -recurse | Select-Object Directoryforeach($Directory in $PNGsdirectory) {Write-Host $Directory.Directory.FullName}$PNGsDirectory contains...
Please Sign up or sign in to vote.
19 Sep 2011
brunofer2007
Delete all alerts for a specific list or library on SharePoint.
Please Sign up or sign in to vote.
19 Sep 2011
André Kraak
I found this piece of code[^] that might do the job.
Please Sign up or sign in to vote.
20 Sep 2011
Soptik Dutta
Explains an alternative way of stsadm restoration of a Site Collection.
Please Sign up or sign in to vote.
3 Oct 2011
lilan madusanka
3 alternatives  
I am use below code. using that i can execute C# code. but I want to execute only C# function. pls any one can help .......... $source = @"public class BasicTestererr{ public static int Add(int a, int b) { return (a - b); } public int Multiply(int a, int...
Please Sign up or sign in to vote.
6 Oct 2011
Joe Leibowitz
Build a simple GUI in PowerShell that will display data queried from a SQL Server table.
Please Sign up or sign in to vote.
26 Oct 2011
Member 8350580
1 alternative  
hi, i'm working on a C# project which interacts with Powershell. I managed to invoke powershell scripts, but how can I get back the values of the powershell variables? Thanks! It's Urgent!
Please Sign up or sign in to vote.
26 Oct 2011
Richard MacCutchan
I have no idea if this is possible, but since it is urgent I would suggest checking some of these links[^].
Please Sign up or sign in to vote.
8 Nov 2011
kuti, ger
1 alternative  
Hey there,i´m developing an application for mobile devices in ASP.NET with access to an Exchange Server 2007. I know you can get with "Get-ActiveSyncDeviceStatistics -Mailbox name" in Powershell information about the userdevice, like FirstSyncTime, DeviceId or DeviceModel. I want to know...
Please Sign up or sign in to vote.
26 Nov 2011
webpeon80
2 alternatives  
in the process of setting up a new/old laptop just as a secondary programming laptop.. im using win xp sp3 32 bit..im almost certain powershell 2.0 installed along with vis studio but cant be sure, how can i be sure..?furthermore, the reason im needing to know is because sql server...
Please Sign up or sign in to vote.
26 Nov 2011
Mehdi Gholam
If in doubt, just reinstall and the installation will tell you if it has been installed or not.
Please Sign up or sign in to vote.
30 Nov 2011
Abhijit Babar
2 alternatives  
I have created Form in Powershell 1.0. It contain 50 controls like Label, Radio Button, Edit Box. I have to apply the specific font to all these controls. Now i am applying font to individual control. I want to apply font to all control in one time.
Please Sign up or sign in to vote.
7 Dec 2011
Joe Leibowitz
Use PowerShell to Query and Display Data II (Active Directory\LDAP)
Please Sign up or sign in to vote.
27 Dec 2011
payne173
3 alternatives  
How can i get all registry keys value like HKLM\Software\Policies\Microsoft\WindowsMediaPlayer may be there are more than hundred keys how can retrieve all keys and there values so that i can apply settings on themfrom c# or PowershellPlease help
Please Sign up or sign in to vote.
27 Dec 2011
Richard MacCutchan
Use the Registry[^] class.
Please Sign up or sign in to vote.
28 Dec 2011
karthi18988
Check this outRead, write and delete from registry with C#[^]
Please Sign up or sign in to vote.
28 Dec 2011
Rajesh Anuhya
Here another good example link Here[^]
Please Sign up or sign in to vote.
28 Dec 2011
Member 8523531
1 alternative  
Hi, I've been learning Powershell and creating some admin scripts. I'd like to be able to be able to give colleagues the access to run these scripts via a web page (and also have the results of the scripts returned via a webpage) but am unsure on how to go about this - do I need to look at...
Please Sign up or sign in to vote.
7 Jan 2012
Paul Jorgensen
Customizable Custom CSharp Control for the Powershell New-PSDrive cmdlet
Please Sign up or sign in to vote.
23 Jan 2012
Catalin Serafimescu
See if this sample of FileSystemAccessRule helps you look into the right way: http://msdn.microsoft.com/en-us/library/system.security.accesscontrol.filesystemaccessrule.aspx[^]
Please Sign up or sign in to vote.
15 Feb 2012
Cai Ming En
1 alternative  
I'm kind of new in powershell, so please pardon me..Let's say we want to create a simple .exe file which can be executed in powershell..Let's say the program is basically can do:if "a" is pressed, it will print the string "a is being pressed" on a new line.if "b" is pressed, it will...
Please Sign up or sign in to vote.
12 Mar 2012
Vivek Krishnamurthy
Power shell script for upgrading Visual Studio 2008 solutions and projects into Visual Studio 2010.
Please Sign up or sign in to vote.
21 Feb 2012
Karl-Einarb
1 alternative  
HelloI have a question i can't seem to find an answer to, and i hope someone can help :)I want to create a application similar to Yakuake, Tilda, etc.Currently i have been able to achive something simelar to this by using a textbox to enter the commands and another textbox to display...
Please Sign up or sign in to vote.
5 Mar 2012
prateekfgiet
2 alternatives  
Hi,i am calling powershell script using asp.net,C#,on powershell prompt.when i run application using visual studio its works fine on same system,but when i host same website in iis on same system it gives error.means script unable to access to data error after hosting site in iis...
Please Sign up or sign in to vote.
5 Mar 2012
Ganesan Senthilvel
sure you load the correct bit-wise version of PowerShell. If you're running the 64 bit version then you'll get the exceptionCould you verify using the x86 powershell console as[System.Reflection.Assembly]::LoadFrom( "C:\windows\system32\inetsrv\Microsoft.Web.Administration.dll" )rather...
Please Sign up or sign in to vote.
5 Mar 2012
prateekfgiet
i have resolved this problem doing some changes in iisin iis application pool coose advance setting --> in process model --> change identity from applicationippool to local system.Thanks all
Please Sign up or sign in to vote.
17 Apr 2012
Altaf N Patel
try following:Process.Start(@"path\to\Powershell.exe", "&'@"-File ""ScriptwithArguments.ps1"" ""arg with space""'""")
Please Sign up or sign in to vote.
17 Apr 2012
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" ...
Please Sign up or sign in to vote.
18 Apr 2012
DataIntegration
The Google Data Provider provides an easy-to-use ADO.NET interface that you can take advantage of with your PowerShell Scripts.
Please Sign up or sign in to vote.
3 May 2012
Sebastian T Xavier
2 alternatives  
Hello,I was trying to connect to a machine(192.168.1.194); using powershell using the following query Enter-PSSession 192.168.1.194. But I got the following error. Enter-PSSession : Connecting to remote server failed with the following error message : Access is denied. For more...
Please Sign up or sign in to vote.
3 May 2012
Dave Kreskowiak
First, this has absolutely nothing to do with C#, so I fail to see why you tagged your question "C#". It should have been "PowerShell".Second, what part of "Access Denied" and "see the about_Remote_Troubleshooting Help topic" you listed in your error message is difficult to understand?
Please Sign up or sign in to vote.
15 May 2012
Fabkhush
2 alternatives  
Recently a task is assigned to me to create a script which restores mutiple databases on SQL Server 2008 R2 server. Powershell was asked to be used..\The daily backkups are stored at share location from where robocopy is done to one of SQL Server. The data files and log files sit a predefined...
Please Sign up or sign in to vote.
15 May 2012
Sebastian T Xavier
1 alternative  
How can I get the URI of my Exchange server 2010 hosted in my network. And what will be the URI of powershell in that sever?Actually I would like to know how I can use the following code?System.Uri uri = new Uri("http://CAS-SERVER/powershell?serializationLevel=Full");When I used it as...
Please Sign up or sign in to vote.
15 May 2012
phil.o
For Outlook Web Access:https://your.server.ip.address.or.dns.name/owa[^]For Exchange Web Services:https://your.server.ip.address.or.dns.name/ews[^](provided you are talking about Exchange 2010, which you did not mention).
Please Sign up or sign in to vote.
15 May 2012
Sebastian T Xavier
1 alternative  
Hello,Wher...
Please Sign up or sign in to vote.
16 May 2012
sjelen
First, check if your URL is correct.Based on the error message, there might be something wrong with Exchange server configuration.Have you enabled Remote Exchange Management Shell as described...
Please Sign up or sign in to vote.
16 May 2012
Chandra Sadhangiri
Try registering the snap-in using C:\Windows\Microsoft.NET\Framework\v2.0.50727InstallUtil c:\program files\microsoft\exchange server\bin\microsoft.exchange.powershell.Configuration.dllNote the difference is in using 32bit version of InstallUtil
Please Sign up or sign in to vote.
25 May 2012
arunbvg
I am new for PowerCLI Scripting. If I connect with my local host (192.168.1.170). Its connected successfully. But If I connect with Virtual Machine (192.168.1.179). Its throws an error. Details as follows.PowerCLI C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Connect-VIServer...
Please Sign up or sign in to vote.
30 May 2012
Tim Corey
If you already have the Powershell code to restore one database file, you are nearly done. Simply do a Powershell command to list all of the backup files in your folder (wherever they are). Then pipe those file names into your restore script and replace the hard-coded file name in the script...
Please Sign up or sign in to vote.
30 May 2012
Fabkhush
Thanks.I have developed the script using for each loop which picks the backup files from a pre defined location, verify backup, read header , does processing for multiple data files and sends an email when restore fails.
Please Sign up or sign in to vote.
10 Jun 2012
Manar Ezzadeen
PowerShell script that generates an HTML report displaying different information about the SQL Server databases, their CLR assemblies and owners.
Please Sign up or sign in to vote.
15 Jun 2012
markovl
Not sure if this is what you're looking for, but try this link:ConvertToSecureString Class[^] on MSDN.It has some examples there. Edited: This can't be the right answer :)On second thought look at the comments at the bottom here[^]Maybe that's where this mysterious method came from...
Please Sign up or sign in to vote.
15 Jun 2012
Tim Corey
What you have here is an authentication issue. I think this like will be able to help you out:http://social.technet.microsoft.com/wiki/contents/articles/8004.scom-2007-exchange-2010-how-to-resolvetest-powershellconnectivity-errors.aspx[^]Here is another link that might help you...
Please Sign up or sign in to vote.
18 Jun 2012
El_Codero
Hi,please read this topic at SO, should also work for you:http://stackoverflow.com/questions/1469791/powershell-v2-remoting-how-do-you-enable-unecrypted-traffic[^]Regards
Please Sign up or sign in to vote.
18 Jun 2012
vikram_shinde
I have a FTP server. On the FTP server, there will be log files per day and alsothere will be multiple files per day. Each file will have datetime stamp appended to filename as follows,log_date_time.csv (log_DDMMYY_HHMM.csv)Some of example filenames for same day are,...
Please Sign up or sign in to vote.
2 Jul 2012
Sandeep Mewara
You write, not us!It does not work like this here.Here is what is expected of enquirers:1. TRY first what you want to do! You may find that it's not that hard.2. Formulate what was done by you that looks like an issue/not working. Try them and tell if you face issues.Members...
Please Sign up or sign in to vote.
3 Jul 2012
Evan Ng
1 alternative  
How to use PowerShell script that will show the free space on the C: drive of your virtual windows machine. Get-WMIObject Win32_LogicalDisk -filter "DriveType=3" -computer localhost | Select SystemName,DeviceID,VolumeName,@{Name="Size(GB)";Expression={[decimal]("{0:N1}"...
Please Sign up or sign in to vote.
3 Jul 2012
Tim Corey
You will need to have network access to your virtual machine if you want to use this particular script. Once you set up your virtual machine to be on your local network like any other physical machine, you can then access it via name or IP address. You would change the "-computer localhost" to...
Please Sign up or sign in to vote.
19 Jul 2012
Mikhail-T
Powershell script that automatically installs and updates your Chromium browser in Windows
Please Sign up or sign in to vote.
11 Jul 2012
Sergey Alexandrovich Kryukov
You can use Windows Automation Snapin for PowerShell, please see:http://wasp.codeplex.com/[^].—SA
Please Sign up or sign in to vote.
12 Jul 2012
barneyman
you've either got to develop an application that understands all the formats you want to search through - Lotus Magellan, anyone? - or use someone else's technologyMS Search seems to know quite a few formats and has an SDK[^]
Please Sign up or sign in to vote.
18 Jul 2012
lewax00
So then what's the problem? Any reason you can't use Dictionary[^] or Hashtable[^]? As far as I know, you can use .Net objects in PowerShell.
Please Sign up or sign in to vote.
23 Jul 2012
graybin
PS > $hash = @{}PS > $hash['class1'] = @('student1')PS > $hash['class1'] += 'student2'PS > $hashName Value---- -----class1 {student1, student2}
Please Sign up or sign in to vote.
14 Aug 2012
priypavan
1 alternative  
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 =...
Please Sign up or sign in to vote.
22 Aug 2012
erdener
1 alternative  
Hello,I am new powershell script in c#. I have a powershell script file ps.ps1 and powershell settingfile ConsoleSettings.psc1 C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -psconsolefile "D:\e\ConsoleSettings.psc1" -noexit -command ". 'D:\e\ps.ps1'"run it and get...
Please Sign up or sign in to vote.
25 Aug 2012
trueknow
1 alternative  
Suppose I have a large number of files in a directory with the .txt extension.How can I change the extension of all these to .c?I KNOW THAT ' ren *.txt *.c ' works from command promt but it did't work from power shell and for terminal.please help!
Please Sign up or sign in to vote.
31 Aug 2012
Zoltán Zörgő
Here is are two tutorials about how you can access the AutoUpdate object from...
Please Sign up or sign in to vote.
2 Sep 2012
Member 9398890
3 alternatives  
Hi,how can I read and automated processing of XML nodes with a "-" in the name with PowerShell. I found this in the help for select-xml: ...
Please Sign up or sign in to vote.
2 Sep 2012
Zoltán Zörgő
I suppose, you don't need the path and the node name. So you can use one of these, supposing, that $books contains the xml:$books | select-xml -xpath "//edition" | % {$_.Node."#text"}$books.SelectNodes("//edition") | % { $_."#text"}$books.book.projects.project."book-editions".edition | %...
Please Sign up or sign in to vote.
2 Sep 2012
gjdfklfgdgfdgfdgfd
Similar to Zoltan's solution, but displays all three columns with headings, as required:$xml = @"
Please Sign up or sign in to vote.
5 Oct 2012
Raj7sam
i have one list for examplelist 1 emp, at location 1name-----empid------salaryemp1------1---------123emp2------ 2------563now when i export this list to location 2 it will be imported as it is but now i make changes in list at location 1, i will change employee 1 name...
Please Sign up or sign in to vote.
16 Oct 2012
NOURANE KOULI
1 alternative  
hey guys..I am little bit shy of what am I asking for, but I have no experience in PowerShell language..I am working on a project using C#.. where I need to read an output of "1 cmdlet" and pass this output as a parameter to another cmdlet...I know it's easy to do using C#, but I am...
Please Sign up or sign in to vote.
16 Oct 2012
Zoltán Zörgő
Use the PowerShell class[^]? Use the AddCommand[^] method to add cmdlets to the processing pipeline. See also: http://stackoverflow.com/questions/527513/execute-powershell-script-from-c-sharp-with-commandline-arguments[^], where you can see an other approach that uses runspace pipeline.
Please Sign up or sign in to vote.
18 Oct 2012
Jean Paul V.A
In this article we will explore a scenario of adding a custom User Profile property and generating a report based on it.
Please Sign up or sign in to vote.
26 Oct 2012
Krishnamurthy M
2 alternatives  
Hi all,Passing parameter for remote execution for powershell script is not working Here the script is present on local machine and has to create a VM on HyperV server while passing servername as paramanterInvoke-Command -ComputerName OIP-HyperV -FilePath...
Please Sign up or sign in to vote.
26 Oct 2012
E.F. Nijboer
You need to read up on how to use UNC path's. C:\ is a local drive that may exists on another computer (dos/windows only) but likely doesn't have the same data. You need to use a more rigorous path definition that specifies the path more specifically, which is UNC....
Please Sign up or sign in to vote.
30 Oct 2012
Lalit kumar Mishra
I am creating a Document Set for a library using powershell and that document set contains some mandatory managed metadata fields. I am able to create document set but how can I insert data into those managed metadata fields at runtime?
Please Sign up or sign in to vote.
30 Oct 2012
Krishnamurthy M
The only thing I did is removing double quotes from the argument and it stated working fine!!! thanks for all your help :-)
Please Sign up or sign in to vote.
30 Oct 2012
Krishnamurthy M
Hi,Does anyone know thw cmdlet for using existing VHD while creating new VM in Hyper-V, please share with me.Thanks,krishna
Please Sign up or sign in to vote.
1 Nov 2012
Jaime Olivares
Configure an Azure solution to create users during deployment
Please Sign up or sign in to vote.
15 Nov 2012
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.
Please Sign up or sign in to vote.
30 Nov 2012
TexaWeb
How to change the name of a SharePoint site in URL
Please Sign up or sign in to vote.
8 Dec 2012
D Sipe
This may not be the right place to request something like this, but I'm hoping at the very least I can get some direction.We currently have a variety of spreadsheets and .bat files we run in preparation for major deployments. It's quite tedious. I would LOVE to be able to get a tool created...
Please Sign up or sign in to vote.
27 Dec 2012
Srivikas
2 alternatives  
Hi friends, I am a fresher in Sharepoint. I have been assigned a task of making the process of deploying a wsp file automatic. For this I need to develop an .exe file which can do all the stuff. I have checked the codeplex project "Sharepoint Solution Installer". But it is not sufficient...
Please Sign up or sign in to vote.
28 Dec 2012
Sergey Alexandrovich Kryukov
In your case, it will be:$value = [BasicTestererr].Add(4, 1)—SA
Please Sign up or sign in to vote.
28 Dec 2012
Christopher Drake
Srivikas - You could use something like this. You'll have to check the SharePoint powershell stuff:using System.Management.Automation;using System.Management.Automation.Runspaces;public class PowershellAutomator{ private Runspace _runSpace; public void...
Please Sign up or sign in to vote.
1 Jan 2013
Sergey Alexandrovich Kryukov
In addition to the correct Solution 1:For complete form of font creation, you should use regular .NET API:In any cases, first you need to load the required assembly in your script:$null = [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")and only...
Please Sign up or sign in to vote.
2 Jan 2013
Falconapollo
2 alternatives  
Get-ChildItem -recurse | Where {$_.PSIsContainer -and ` @(Get-ChildItem -Lit $_.Fullname -r | Where {!$_.PSIsContainer}).Length -eq 0} | Remove-Item -recurse -whatifnow i can use the above PowerShell script to delete files permanently, but now i want the files be removed to recyle...
Please Sign up or sign in to vote.
2 Jan 2013
DinoRondelly
This should help, similar question,http://stackoverflow.com/questions/502002/how-do-i-move-a-file-to-the-recycle-bin-using-powershell[^]
Please Sign up or sign in to vote.
2 Jan 2013
Zoltán Zörgő
Look at these ones (source[^]). Not elegant, since they invoke COM :(, but should work:$shell = new-object -comobject "Shell.Application"$path = ""$item = $shell.Namespace(0).ParseName("$path")$item.InvokeVerb("delete")or$shell = new-object -comobject...
Please Sign up or sign in to vote.
4 Jan 2013
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
Please Sign up or sign in to vote.
6 Jan 2013
Adel Refaat
How to convert multiple SharePoint 2010 projects to SharePoint 2013
Please Sign up or sign in to vote.
10 Jan 2013
shivanand3291
hi, i have windows server 2008r2 with sharepoint 2010 intalled I got backup of one of my site by performing " Export site or list" option in central administration. then i got a file named xxx.cmp as site backup. I am restoring onto my another website through windows powershell using...
Please Sign up or sign in to vote.
21 Jan 2013
MJ Ferdous
Update the "Created By" and "Modified By" Columns in SharePoint lists using PowerShell
Please Sign up or sign in to vote.
27 Jan 2013
Sebastian T Xavier
Hi All,I have a powerhsell script( to get the mailbox size of an exchange 2010 mailbox), and I am executing this script in my C# code. The following is the code I have used for that powershell.AddScript(strQuery);Collection objPS = powershell.Invoke();I tried to get the properties from...
Please Sign up or sign in to vote.
22 Jan 2013
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...
Please Sign up or sign in to vote.
14 Feb 2013
thajudeen301190
1 alternative  
Back End : Ms Access Front End : Vb.Net or Asp.Net or PowershellMailing : Outlook or server side(gmail or yahoo)I need to retrieve the data from database and send an email to the user.Scenario for Example:Database looks like below,Product_ID Product_Name ...
Please Sign up or sign in to vote.
14 Feb 2013
Jameel VM
You can send mail from Outlook by using Exchange web Services. The below link will help you.http://code.msdn.microsoft.com/Send-Email-with-Exchange-50189e57[^]Examples on MSDNhttp://msdn.microsoft.com/en-us/library/ms878112[^]Hope this helps
Please Sign up or sign in to vote.
15 Feb 2013
Rumnha
PowerShell in general can be used for searching text in files. The same fearture helps to get required debugging info from log files on the production server,
Please Sign up or sign in to vote.
7 Mar 2013
madagaga
Code sample to monitor file size on server.
Please Sign up or sign in to vote.
14 Mar 2013
Jeffrey T. Fritz
In this article, I will show you how to configure the "GitHub for Windows" application to interact with a BitBucket repository.
Please Sign up or sign in to vote.
26 Mar 2013
Vikram Stephen
1 alternative  
Hi,I am trying to take a BackUp of a Site Collection from a remote computer, but I am getting a error that i am not sure of the script is:Invoke-Command -ComputerName remotecomputername -ScriptBlock {Backup-SPSite -Identity "http://remotecomputername:8080" -Path...
Please Sign up or sign in to vote.
26 Mar 2013
Zoltán Zörgő
I am not a big SharePoint guru, but I think you can't do this directly.1) You have to enable PSRemoting: http://technet.microsoft.com/en-us/library/hh849694.aspx[^]2) Than enter remote session: http://technet.microsoft.com/en-us/library/hh849707.aspx[^] or import remote session:...
Please Sign up or sign in to vote.
29 Mar 2013
rammohan004
1 alternative  
Hi,I am Trying to Run Powershell from C# with the help of System.Diagnostics.Process class.I tries passing commands to the powershell as Arguments but Nothing happens here. Powershell starts in the Task Manager but it does not accepts the commands.Plz tell me changes is required here to...
Please Sign up or sign in to vote.
29 Mar 2013
rammohan004
Hi,I am trying to execute powershell to copy some files from one server to another in .Net.I have executed copy-item command using system.diagnostics.process from the C#. But When the Copying of files completes the Powershell Remains Open. and I have to End the Powershell Manually from...
Please Sign up or sign in to vote.
2 Apr 2013
Mike Meinz
You have a syntax error in the commands that you are sending to PowerShell.Change your code a bit so you can see the error message from PowerShell. In Visual Studio Debug mode, capture the value of "c" just before you assign it to startinfo.arguments and use it in an interactive PowerShell...
Please Sign up or sign in to vote.
1 Apr 2013
PratapReddyP
Wait for Retract / Uninstall before Remove.
Please Sign up or sign in to vote.
2 Apr 2013
Sergey Alexandrovich Kryukov
The first problem I can see is that your calculated $now is not really the date. Yes, this is a bit confusing…"Today" means that you need to check up if some time is greater of equal the any time of the same date. This is not what happens in your code. Let me run this code right...
Please Sign up or sign in to vote.
4 Apr 2013
Sebastian T Xavier
Hi All,I was trying to execute following exchange server 2007 (powershell) command.$server='exchangeserver.abc.local';$pwd= convertto-securestring '123' -asplaintext -force;$cred=new-object -typename System.Management.Automation.PSCredential -argumentlist 'Administrator',$pwd;...
Please Sign up or sign in to vote.
7 Apr 2013
Sudhirsingh20