All posts filed under: featured

PowerShell 2.0 remoting guide: Part 4 – Execute commands or scripts on a remote computer using Invoke-Command

I’ve published a free book on PowerShell 2.0 remoting. You can download it at: In this part of PowerShell remoting series, I will discuss how to run commands or scripts on remote computer(s). Within remoting, there are couple of ways to run commands or scripts on a remote machine. This includes Invoke-Command cmdlet and interactive remoting sessions. These two methods deserve a separate post for each and hence I will discuss the Invoke-Command method in today’s post. Once you have enabled remoting on all your computers, you can use Invoke-Command cmdlet to run commands and scripts on local computer or on remote computer(s). There are many possible variations of this cmdlet. I will cover most of them here. Invoke-Command to run commands on local or remote computer You can invoke a command on local or remote computer(s) using the below method

The ScriptBlock parameter can be used to specify a list of commands you want to run on the remote computer.  ComputerName parameter is not required for running commands on the local machine. If …

PowerShell 2.0 remoting guide: Part 3 – Enable remoting

I’ve published a free book on PowerShell 2.0 remoting. You can download it at: In this part of the series of articles on PowerShell 2.0 remoting, we will look at how to enable remoting in different scenarios. This post assumes that you are running a supported operating system and you have installed all necesary pre-requisite software. So, how do you enable remoting? Remoting in PowerShell 2.0 can be enabled by just running the following cmdlet Enable-PSRemoting Note: You have to run this at a elevated PowerShell prompt. Also, all your active networks should be set to “Home” or “Work” network location. Setting firewall exceptions for remoting will fail if the network location is set to “Public”. Yes. That is it. You will be asked to respond to a couple of questions — based on OS architecture — as you see in the screenshot here. Enable-PSRemoting As you see above, Enable-PSRemoting internally uses Set-WSManQuickConfig and a few other cmdlets. The second prompt around Microsoft.PowerShell32 will appear only on x64 OS. However, you should always use the more comprehensive Enable-PSRemoting cmdlet. If you don’t want to …

PowerShell 2.0 remoting guide: Part 2 – Overview of remoting cmdlets

I’ve published a free book on PowerShell 2.0 remoting. You can download it at: In part 1 of this series I gave a quick introduction to PowerShell 2.0 remoting. Before we look at how to enable or configure a computer for remoting, let us take a quick look at PowerShell 2.0 remoting cmdlets. Here is a complete list of cmdlets with a brief overview. This list will also include cmdlets that are not directly used within remoting but help configure various aspects of remoting. The knowledge of  these cmdlets such as WSMan, etc in this list is not mandatory for basic usage of PowerShell remoting. In this post, I will only discuss what each of these cmdlets are capable of and list any gotchas. A detailed usage of these cmdlets will be discussed later in the series. Enable-PSRemoting The Enable-PSRemoting cmdlet configures the computer to receive Windows PowerShell remote commands that are sent by using the WS-Management technology. This cmdlet will be the first one to run if you want to use PowerShell 2.0 remoting …

PowerShell 2.0 remoting guide: Part 1 – The basics

I’ve published a free book on PowerShell 2.0 remoting. You can download it at: I am starting a series of articles on remoting feature of PowerShell 2.0. This is one of the best features of PowerShell 2.0 and my favorite feature for sure. The number of very cool things one can achieve using this feature is just un-imaginable. I have started digging deep in to this feature as I start writing a network file browser powerpack as a part of hands-on. I hope it is worth sharing what I learn by writing about it here. So, this is the first in that series of posts. In this post, we will look at absolute basics to start using PowerShell remoting. What is PowerShell remoting? This is a new feature in PowerShell 2.0 that enables remote management of computers from a central location. Remoting uses WS-Management to invoke scripts and cmdlets on remote machine(s). This feature also enables what is known as “Universal Code Execution Model” in Windows PowerShell v2. UCEM means that whatever runs locally should run anywhere. PowerShell …

Shell Extentions for VHD files – release 1.6

I just made another release of VHDShellExt.vbs. This will be the final release unless there are any bugs with the script. This release contains an IE based progress window and a few bug fixes. I tried various other options to represent the progress of any given task but I felt using IE instance was the easiest and most efficient way to represent progress. Here is how it looks       This IE progress window will appear only when you directly use the context menu to perform an action on the VHD or when you use WScript as the scripting engine to run VHDShellExt.vbs. Otherwise, you will see the progress in terms of a few dots on the screen and a message (success/fail) at the end. Like I mentioned in my previous post, I wasn’t really planning to complete this feature addition this week. But thanks to my 5 months old son. He has been really cooperative today 🙂 Let me know your thoughts on this tool. Technorati Tags: Hyper-V VHD,VHD right-Click,VHD Shell Extensions,VHD Mount,VHD …