header image

Archive for January, 2015

Add-Computer is your friend

Posted by: | January 11, 2015 Comments Off on Add-Computer is your friend |

When spinning up new machines and joining them to the domain at least 2 reboots are required. One when you rename the machine (Windows used to let you specify the name at install time – the removal of that feature was a step backwards) and the other when you join it to the domain.   […]

under: PowerShell and Active Directory

foreach, pipelines and $_

Posted by: | January 9, 2015 Comments Off on foreach, pipelines and $_ |

I’ve recently seen a few questions where people have been using a pipeline inside a foreach loop and experienced problems when they’ve tried to access properties on the looping objects. To illustrate we’ll start with a CSV file containing emailaddresses and job titles. £> Import-Csv -Path C:\Test\userdata.txt emailaddress             title    ————             —–    gdreen@Manticore.org     Boss     dbrown@Manticore.org     Underling […]

under: PowerShell and Active Directory, PowerShell Basics

DHCP scope lease time

Posted by: | January 7, 2015 Comments Off on DHCP scope lease time |

I wanted to reduce the lease time on a DHCP scope   $lt = New-TimeSpan -Hours 12 Set-DhcpServerv4Scope -ScopeId 10.10.54.0 -LeaseDuration $lt   You could even make it a one liner if you wished   Set-DhcpServerv4Scope -ScopeId 10.10.54.0 –LeaseDuration (New-TimeSpan -Hours 12)

under: DHCP, PowerShell, Windows Server 2012, Windows Server 2012 R2

A use for default parameters – default powershellget repository

Posted by: | January 6, 2015 Comments Off on A use for default parameters – default powershellget repository |

When you use Find-Module by default all repositories are searched £> Find-Module -Name Pester | ft Version, Name, Repository -a Version Name   Repository ——- —-   ———- 3.2.0   Pester PSGallery 3.2.0   Pester PowerShellModules   If you don’t give a module name that could be a lot of data to sort through. If you are running an […]

under: PowerShell v5, PowerShellGet

PowerShell Summit Europe 2015–topic submissions

Posted by: | January 6, 2015 Comments Off on PowerShell Summit Europe 2015–topic submissions |

Topic submissions for the PowerShell Summit Europe are still open. If you want to be considered as a speaker please submit your topic very soon.   At the moment there aren’t enough submissions to enable us to put on a quality event. The 2014 European Summit was an excellent event with many good sessions – […]

under: European Summit, PowerShell

Accessing your PowerShellget repository from another machine

Posted by: | January 5, 2015 Comments Off on Accessing your PowerShellget repository from another machine |

So far the new PowerShellGet repository has been accessed from the local machine. You need to register the new repository on each machine from which you want to access it. Register-PSRepository -Name PowerShellModules -SourceLocation http://W12R2DSC:81/nuget/PowerShellModules -InstallationPolicy Trusted   The only change to is substituting the name of the server for localhost in the source location […]

under: PowerShell v5, PowerShellGet

Working with multiple PowerShellGet repositories

Posted by: | January 5, 2015 Comments Off on Working with multiple PowerShellGet repositories |

In http://blogs.msmvps.com/richardsiddaway/2015/01/04/creating-a-powershellget-repository/  I showed how to create a repository to use with PowerShellGet.  At the end of that article PowerShellGet would search all of the defined repositories for a module £> Find-Module -Name Pester | Format-Table Version, Name, Repository -AutoSize Version Name   Repository ——- —-   ———- 3.2.0   Pester PSGallery 3.2.0   Pester PowerShellModules   If you […]

under: PowerShell v5, PowerShellGet

Creating a PowerShellGet repository

Posted by: | January 4, 2015 Comments Off on Creating a PowerShellGet repository |

In this post – http://blogs.msmvps.com/richardsiddaway/2014/12/21/delivering-powershell-code-with-the-november-preview/ – I showed how to use PowerShellGet, which is a feature new to PowerShell 5.0 to install PowerShell modules. By default PowerShelget uses the PowerShell gallery at https://www.powershellgallery.com as its source.   I don’t feel comfortable installing modules direct from a public gallery so I want my own.  I suspect […]

under: PowerShell v5, PowerShellGet

PowerShell in 2015

Posted by: | January 1, 2015 Comments Off on PowerShell in 2015 |

See Don Jones’ predictions for PowerShell in 2015 – http://blogs.technet.com/b/heyscriptingguy/archive/2015/01/01/powershell-predictions-for-2015.aspx

under: PowerShell

« Newer Posts

Categories