Linux has always been an important part of the server infrastructure world and SSH has been the primary method of connecting to it. PowerShell can now use same underlying SSH Protocol to perform SSH and manage Linux servers centrally. This functionality allows us to seamlessly incorporate Unix servers using the known PSRemoting commands into the PowerShell scripts. PowerShell based SSH remoting creates a PowerShell host process on the target computer as an SSH subsystem. In this blog post, we’ll learn how we can enable and use the same on one of the popular Linux distributions, Ubuntu. The same set of steps can be used for other Linux distributions as well.Read More »
In our previous blog post, we discussed how we can write custom Azure Policies in accordance with Organization’s Strategic and Compliance Requirements. We also learned how to apply policies at different scope levels in Azure. While planning, writing and applying compliance requirements in the form of Azure Policies is important, it is equally important to audit existing resources for appropriate configurations and settings, evaluate the results and take certain actions. One needs to be evaluate how many resources are compliant with the defined requirements, what resources are non-compliant, what corrective actions can be taken to bring them in compliance and also remove any false positives.
Read More »
In our previous blog post, we discussed on using Azure Policies for Azure Governance and staying compliant with the same. We also discussed how we can use built-in Azure Policies to meet the governance criteria and start easily. However, the relationship between business and IT varies a lot from Organization to Organization. So from time to time, you’ll need to create your own Azure Policies and applying them to a scope. Custom Azure policies allows you to be lot more compliant and a lot more flexible. In this blog post, we are going to discuss the same. Read More »
With the arrival of the Sprint 154 updates, auditing has been introduced in the Azure DevOps. This has been a long standing demand from various enterprises (including Ours !). We wanted to observe activities and monitor changes that have occurred in the Azure DevOps across the Organization. It is in the preview phase as of this writing of this blog post, but it is very useful in the preview phase as well. In this blog post, we are going to see what is recorded in the Azure DevOps as part of the auditing, how we can access it and what we can do with the same.
Read More »
It is good practice to use the various -Verbose, -Debug and other about_CommonParameters when writing functions because it helps one to write the clean code in a very integrated way with the PowerShell. This blog post focuses on the usage of Verbose command to provide detailed tracking information and status. One of the main benefits about using Write-Verbose command is that you can control, if you need extra detailed information. By default, the verbose message stream is not displayed, but you can display it by changing the value of the $VerbosePreference variable or using the Verbose common parameter in any command. Also, Write-Verbose writes to the verbose output stream and you can capture it separately.
Read More »
In PowerShell functions, by default, you can return only one object at a time. Since PowerShell does not apply any restriction on data type returned, it created a lot of possibilities on what can be returned as an output of the function. So if one needs to return multiple values or objects, it is generally suggested to create an array of the objects and then return the array. If the underlying values are simple strings, some would create a custom PSObject and then return the PSObject. In this blog post, we will discuss the other methods to return the multiple values from PowerShell functions.
Read More »
In our previous post, we learned how to make use of Begin, Process and End blocks to implement proper pipeline support. Building on to that, in this blog post, we’ll learn further about when to make use of ValueFromPipeline property and when to make use of ValueFromPipelineByPropertyName and what happens behind the scenes.
Multiple parameters that accept Pipeline Input
What if there are multiple parameters that can accept pipeline input and we need to run the Process block for them. Let’s consider below code:Read More »
Of many things that make PowerShell stand apart in the world of scripting languages, perhaps two are most fundamental to it: first, its treats everything as Objects and second, the ability to pipe objects from one cmdlet to another. Using this capability, we can effortlessly link multiple cmdlets together. Doing this will also throttle the amount of memory that is being allocated (in most cases) that the current session is using for the commands. So, its very natural that you would want to implement pipeline support for your own function, that you just wrote.
Read More »