Browse by Tags

All Tags » PowerShell V2 (RSS)

Clearing hosts file

We seen how to delete a single entry from the hosts file – this is how we clear all entries function clear-hostfilecontent { [ CmdletBinding ( ) ] param ( ) $file = Join-Path -Path $( $env:windir ) -ChildPath "system32\drivers\etc\hosts" if...
Posted by RichardSiddaway | with no comments

Remove a host file record

Next up is removing a record from a hosts file function remove-hostfilecontent { [ CmdletBinding ( ) ] param ( [ parameter ( Mandatory = $true ) ] [ ValidatePattern ( "\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b" ) ] [string] $IPAddress , [ parameter...
Posted by RichardSiddaway | with no comments

Hosts file - add a record

We’ve seen how to read the Hosts file – this is how we add a record function add-hostfilecontent { [ CmdletBinding ( SupportsShouldProcess = $true ) ] param ( [ parameter ( Mandatory = $true ) ] [ ValidatePattern ( "\b\d{1,3}\.\d{1,3}\.\d{1,3}\....

Reading the hosts file

Normally I ignore the Hosts file but my development laptop isn’t a member of my test domain – a number of reasons for this which I won’t go into. This means that when I want to RDP to a machine in the test domain I have to use the IP address. A bit awkward...

select-object quirk

I was working with the new CIM cmdlets in PowerShell 3 CTP and mistyped a command (as I thought) Get-Cimclass win32_operatingsystem | select -ExpandProperty methods | select -f 1 select -ExpandProperty Qualifiers   My surprise was because of the...
Posted by RichardSiddaway | with no comments

PowerShell Deep Dive speakers

Some more sessions have been announced for the Deep Dive http://www.theexpertsconference.com/europe/2011/powershell-deep-dive/session-abstracts/ The speaker line up includes: Aleksandar Nikolic Shay Levy Kirk Munro Dmitry Sotnikov Jeffery Hicks James...

UK User Group–Alexsandar

Quick reminder about the UK User group Live Meeting on remoting and end points presented by PowerShell MVP Alexsandar Nikolic. Details and link to join from http://msmvps.com/blogs/richardsiddaway/archive/2011/09/08/powershell-user-group-20-september...

Create a calendar item

Continuing the occasional look at Outlook automation its time to see how we create a calendar item function new-calendaritem { param ( [string] $mailbox , [datetime] $start , [datetime] $end , [string] $subject , [string] $location , [string] $body )...
Posted by RichardSiddaway | with no comments

Process information

Recent forum question got me thinking about retrieving process information. In this case it was about a processes Working Set   Standard response is PS> Get-Process powershell | select *working* MaxWorkingSet    : 1413120 MinWorkingSet   ...
Posted by RichardSiddaway | with no comments
Filed under: ,

PowerShell User Group–20 September 2011

When: Tuesday, Sep 20, 2011 7:30 PM (BST) Where: *~*~*~*~*~*~*~*~*~* Aleksandar Nikolic presents on PowerShell remoting and the customisation of remoting end points. Aleksandar's presentation at the PowerShell Deep Dive was excellent - don't miss...

Timer

In this post I showed how to set a count down timer http://msmvps.com/blogs/richardsiddaway/archive/2011/08/02/a-count-down-timer.aspx but what if you want to go the other way i.e. see how long something takes The count down function can be modified Import...
Posted by RichardSiddaway | with no comments
Filed under: ,

Controlling Firewall Rules

I decide that for this module I wanted some functions that control specific rule that I could be working with often e.g. Enable/Disable WMI rules and then I want a generic function for everything else. Lets start with some specifics. If we look at the...
Posted by RichardSiddaway | with no comments
Filed under: , ,

Firewall rules (OK)

The really important thing about our firewall is the rules that are configured. function get-rule { [ CmdletBinding ( ) ] param ( ) BEGIN { } #begin PROCESS { $fw = New-Object -ComObject HNetCfg.FwPolicy2 $fw . Rules | foreach { $profiles = @( ) $ruleprofile...
Posted by RichardSiddaway | with no comments
Filed under: , ,

PowerShell Deep Dive abstracts

With the Deep Dive just over 6 weeks away the programme is shaping up.Abstracts of some of the sessions can be viewed http://blogs.msdn.com/b/powershell/archive/2011/09/01/8-abstracts-for-the-powershell-deep-dive-in-frankfurt.aspx   I will also be...
Posted by RichardSiddaway | with no comments
Filed under: ,

Windows firewall

I normally leave the Windows firewall enabled in my test environment. It ensures I don’t forget it when testing. My recent session for the TechEd:Australia PowerShell conference involved me disabling various firewall rules on the subject machine to set...
Posted by RichardSiddaway | with no comments
Filed under: , ,

Deal of the Day–PowerShell

PowerShell and WMI is Manning’s deal of the day – 50% off print or e-book.   The deal also extends to PowerShell in Practice and PowerShell in Action 2E See www.manning.com for details
Posted by RichardSiddaway | with no comments
Filed under: ,

Reminder: TechEd Australia PowerShell conference

The TechEd Australia PowerShell conference starts tomorrow at midnight UK time (9am in Australia).  Details from http://msmvps.com/blogs/richardsiddaway/archive/2011/08/22/teched-australia-powershell-conference.aspx   I will be presenting on...
Posted by RichardSiddaway | with no comments
Filed under:

TechEd Australia PowerShell conference

Tuesday August 30th 2011 at 9am EST there is a PowerShell conference at TechEd Australia.  Details from http://powershelldownunder.com/featured/teched2011/ The sessions will be available via Live meeting please register at above URL
Posted by RichardSiddaway | 2 comment(s)
Filed under:

Path cmdlets: 6 Convert-Path

The last of the path cmdlets is Convert-Path.  The Convert-Path cmdlet converts a path from a Windows PowerShell path to a Windows PowerShell provider path. I can’t remember using this one.  Building on the examples in the help file we can expand...
Posted by RichardSiddaway | with no comments
Filed under:

Half price PowerShell books

Check www.manning .com for a half price deal on PoweShell books: PowerShell in Practice PowerShell and WMI PowerShell in Action Learn PowerShell in a month of lunches Hurry. Today only!
Posted by RichardSiddaway | with no comments
Filed under: ,
More Posts « Previous page - Next page »