One of the great things about work flows is that you can stop and start them. A workflow can be stopped, on a temporary basis, by using the Suspend-Workflow activity. workflow suspend1 { Get-Service Suspend-Workflow Get-Process } suspend1 This will run the Get-Service activity – and produce output to the console. The workflow will […]
Archive for June, 2014
I had a comment left on my recent post – “Bad practices – making scripts needlessly interactive” asking how to deal with the situation of N servers consecutively numbered e.g. server01 to server05. Taking the script from that post as an example: [CmdletBinding()] param ( [string[]]$computername ) foreach ($computer in $computername){ Restart-Computer -ComputerName […]
In my last post I questioned why commands from CDXML didn’t fail as thee weren’t any activities defined for them. Turns out that functions and other commands that don’t explicitly have their own workflow activities are implicitly wrapped in the inline script activity. As CDXML modules effectively create a function – that means that workflows […]
Last time we saw that you’re not really using cmdlets in PowerShell workflows – you’re using workflow activities. Some cmdlets haven’t been packaged into activities and for those you need to put them in an Inlinescript block. You can also use an Inlinescript block to run any arbitrary piece of PowerShell. One thing I hadn’t […]
Bad practices – making scripts needlessly interactive
Posted by: richardsiddaway | June 23, 2014 | 1 Comment |the PowerShell community spends a lot of time talking about best practices when using PowerShell. I’m not convinced this approach is working as we keep seeing the same bad practices coming through on forum questions. I thought I’d turn the problem on its head and present a now-and-again series of bad practices. These are things […]
PowerShell.org are starting a series of technical webinairs. Details from http://powershell.org/wp/techsession-webinars/
This is a simple function to return some data about a system: function get-serverdata { Get-CimInstance -ClassName Win32_OperatingSystem Get-Service Get-Process } get-serverdata The function will return the CIM data about the operating system, then the service data and then the process data. The only difference to running the cmdlets interactively is that the display […]
PowerShell Summit Europe 2014 – – reasons to attend 1..7
Posted by: richardsiddaway | June 21, 2014 | No Comment |With the opportunity to register for the first PowerShell Summit in Europe fast approaching you may be looking for reasons you can use to convince your boss to let you go. These are just some of the reasons you should attend: Excellent sessions - our sessions are deliberately kept short and focussed. There’s no time […]
PowerShell Summit Europe 2014 – – update 2
Posted by: richardsiddaway | June 20, 2014 | No Comment |There seems to have been a bit of confusion regarding the European PowerShell Summit as the site will tell you that registration is currently unavailable. There isn’t a problem and the Summit HAS NOT sold out at this time. We just haven’t opened registration yet. Registration will open on 15 July 2014
I said in the first post in this series that you could force a workflow to perform tasks in parallel or in sequence. Starting with parallel you can force parallel execution by using the parallel keyword: workflow thursday1 { parallel { 1..26 | foreach {$psitem} 65..90 | foreach {[char][byte]$psitem} 97..122 | foreach […]
Categories
- .NET
- Active Directory
- Architecture
- Azure
- Bash
- BITS
- Books
- CDXML
- CIM
- Cloud
- COM
- Containers
- Deep Dive
- Desired State Configuration
- DevOps
- DHCP
- DNS
- DSC
- European Summit
- Events
- Exchange
- File System
- Firewall
- General
- General IT Matters
- Hyper-V
- IIS
- Infrastructure
- IT Community
- IT Security
- Learning PowerShell
- Linux
- Math
- Microsoft
- Modules
- Nano Server
- Networking
- Office 2010
- Office 2013
- Open Source
- Opinion
- Outlook
- Philosophy
- PowerShell
- PowerShell 7
- PowerShell and .NET
- PowerShell and Active Directory
- PowerShell and CIM
- PowerShell and Exchange 2007
- PowerShell and IIS
- PowerShell and SQL Server
- PowerShell and WMI
- PowerShell Basics
- PowerShell original
- PowerShell Summit
- PowerShell User Group
- PowerShell User Group 2
- PowerShell v2
- PowerShell V3
- PowerShell v4
- PowerShell v5
- PowerShell v6
- PowerShell.org
- PowerShellGet
- PowerShellV2
- PSAM
- Rant
- Registry
- Scripting
- Scripting Games
- Scripting Games 2104
- Security
- SQL Server
- Storage
- Strings
- Summit
- Technology
- Uncategorized
- Virtualization
- Windows 10
- Windows 2012 R2
- Windows 7
- Windows 8
- Windows 8 Server
- Windows 8.1
- Windows Server
- Windows server 1709
- Windows Server 2008
- Windows Server 2008 R2
- Windows Server 2012
- Windows Server 2012 R2
- Windows Server 2016
- Windows Server 2019
- WMFv5
- WPF
- WSUS