header image

Archive for July, 2015

Windows 10

Posted by: | July 29, 2015 Comments Off on Windows 10 |

Went through the Windows 10 upgrade procedure this morning. Fairly quick process – just over the hour including download on a slow broadband link. Most of my settings from Windows 8.1 were saved.   So far impressions are reasonable to good.   PowerShell 5.0 is installed £> $PSVersionTable Name                           Value —-                           —– PSVersion                      5.0.10240.16384 WSManStackVersion              […]

under: Windows 10

PowerShell Summit NA 2016–call for topics warning

Posted by: | July 28, 2015 Comments Off on PowerShell Summit NA 2016–call for topics warning |

A conference organiser’s work is never done. The dust has just settled from PowerShell Summit NA 2015 and we’re gearing up for PowerShell Europe 2015.   We also need to start thinking about PowerShell NA 2016! A post on powershell.org http://powershell.org/wp/2015/07/28/powershell-summit-na-2016-call-for-topics-coming-soon/   serves as a warning to start thinking about topics for PowerShell NA 2016 […]

under: PowerShell, Summit

WMI dates

Posted by: | July 28, 2015 Comments Off on WMI dates |

Dates as reported by WMI still seem to cause a lot of problems. If you use the WMI cmdlets £> Get-WmiObject -Class Win32_OperatingSystem | select *date* | fl InstallDate   : 20131205101649.000000+000 LocalDateTime : 20150728121320.002000+060   That format is year, month, day, hour, minute, second then fractions of a second after the decimal point with the […]

under: CIM, PowerShell and WMI, PowerShell Basics

Self signed certificates for testing

Posted by: | July 25, 2015 Comments Off on Self signed certificates for testing |

A question on the forum http://powershell.org/wp/forums/topic/cannot-add-digital-signature-to-my-script/#post-27883 indicated a problem when using a self signed certificate for testing code signing.   According to the about_signing help file CREATE A SELF-SIGNED CERTIFICATE ——————————–     To create a self-signed certificate in use the New-SelfSignedCertificate     cmdlet in the PKI module. This module is introduced in Windows PowerShell     […]

under: PowerShell

Devops tools

Posted by: | July 23, 2015 Comments Off on Devops tools |

DevOps is the fusion of development and operations practices to give you faster, more reliable, roll out of functionality to your organisation.  Its a growing area and while much of DevOps practice is cultural rather than technical you will need at least some tools to get the job done.   There are a growing number […]

under: DevOps

PowerShell documentation and more

Posted by: | July 22, 2015 Comments Off on PowerShell documentation and more |

PowerShell has a new home.  This site on MSDN https://msdn.microsoft.com/en-us/powershell is the centre for Microsoft’s PowerShell documentation. Book mark it now!

under: PowerShell

Using parameters instead of read-host when getting AD replication data

Posted by: | July 22, 2015 Comments Off on Using parameters instead of read-host when getting AD replication data |

I’ve seen a lot of scripts recently that use Read-Host to get input data.  This is generally not best practice – I tend to only use Read-Host if I want to get a password and obscure the text on screen.   A better practice is to use parameters – either in a function or a […]

under: PowerShell and Active Directory, PowerShell Basics

Data for comparisons

Posted by: | July 21, 2015 Comments Off on Data for comparisons |

A question on the forum asked about storing data used in comparisons, The example was based on a list if IP addresses where some were known to be good and the questioner wanted to filter out the known good ones so he just had to investigate the rest.   You could put the data in […]

under: PowerShell Basics

Input validation on multiple regex

Posted by: | July 20, 2015 Comments Off on Input validation on multiple regex |

One of the things I like about writing advanced functions is the ability to validate the input. if you test the input immediately you can  often stop mistakes being made. Mistakes that could damage your system!   One of the validation options is to test the input against a regular expression. Not being a big […]

under: PowerShell Basics

get-computerDN–dealing with non-existant computers

Posted by: | July 17, 2015 Comments Off on get-computerDN–dealing with non-existant computers |

If you look at the working part of the code to discover the distinguished name of a computer:   £> $computer = ‘w12r2sus’ £> $filter = “(&(objectCategory=computer)(objectClass=computer)(cn=$computer))” £> ([adsisearcher]$filter).FindOne().Properties.distinguishedname CN=W12R2SUS,OU=Servers,DC=Manticore,DC=org   What happens if the computername you chose doesn’t exist?   £> $computer = ‘w12r2nope’ £> $filter = “(&(objectCategory=computer)(objectClass=computer)(cn=$computer))” £> ([adsisearcher]$filter).FindOne().Properties.distinguishedname £>   You don’t […]

under: PowerShell and Active Directory

Older Posts »

Categories