Posts

How to write basic scripts and functions in powershell 6

Image
We are going well with the PowerShell tutorial, we saw how to use credentials and how to work with variables, array, and hash tables.
In the last post, we discussed with the overview of working with script blocks.
In this post, we are going to dig deeper into those with understanding how to design and convert it into functions.
In this post we are going to cover the below topics:

Script vs functionsPass parameters to a scriptConvert to functionsBest practices for designing functions



You can accomplish many tasks in PowerShell by typing a command and pressing Enter in the shell console.        We expect when you are starting up writing commands on the PowerShell console and getting the required output.
      But you hand off a task to someone else and need to make sure that it’s done exactly as planned.
      That’s where scripts come in—and it’s also where functions come in.

SCRIPT OR FUNCTION?

Suppose you have some task, perhaps one requiring a handful of commands in order to complete.
 A scri…

How to work with Variables, arrays, hash tables, and script blocks in Powershell

Image
I have been recently working mostly on PowerShell /Azure, hence decided to covers lots of easier topics from this space. So that you can get familiar with this. In the previous post, we looked into Credentials and how to use them while automating things. In this post we are covering ·Variables ·Strict mode ·Variable drives and cmdlets ·Arrays ·Hash tables ·Script blocks


VARIABLES

Variables are a big part of any programming language or operating system shell, and PowerShell is no exception. In this post, we’ll explain what they are and how to use them, and we’ll cover some advanced variable-like data structures such as arrays, hash tables, and script blocks.

Variables are important for the creation of good scripts.
A variable is like a placeholder and every kind of object and type can be stored in that variable.
You can save data that is often used within a script in it or you can make calculations with it. You can forward variables containing data to functions, to make changes or output with the…

How to work with Credentials Parameter in powershell 6

Image
In the previous post, We worked on to get started with Windows PowerShell. We looked at setting up the PowerShell environment and running a sample Script.
In this post, we will learn and understand an important part while automating things is working with credentials. While many of the cmdlets parameters support credentials.
Most of those cmdlets, whether you work on PowerShell Core or Windows PowerShell, can be executed remotely and with different credentials.
In order to see which cmdlets support a Credential parameter, you can use the ParameterName parameter with Get-Command to discover them.




Examples: Get-Command -ParameterName Credential

First of all, we need to see what a credential actually is by looking at the following code :
$username = ‘venkat’ $password = 'P@ssw0rd' | ConvertTo-SecureString -AsPlainText -Force $newCredential = New-Object -TypeName pscredential $userName, $password $newCredential.GetType().FullName $newCredential | Get-Member
Looking at the code, you…

Powershell 6 -Getting Started with Automating System Administration

Image
Windows PowerShell is a task-based command-line shell and scripting language designed specifically for system administration.
Built on the .NET Framework, Windows PowerShell helps IT professionals and power users control and automate the administration of the Windows operating system and applications that run on Windows.
This post is to help you get up and running with PowerShell, taking you from the basics of installation to writing scripts and web server automation.
This will act as an introduction to the central topics of PowerShell, from finding and understanding PowerShell commands and packaging code for reusability right through to a practical example of automating IIS.
You will explore the PowerShell environment and discover how to use cmdlets, functions, and scripts to automate Windows systems.





Accessing the PowerShell Console and PowerShell ISE
We will see how to access the PowerShell console and PowerShell ISE Console and work with PowerShell 6 module.
We will cover how to :
T…

The Guide to DeepLearning with Tensorflow and Keras - The Beginning

Image
Learn how to build a neural network and how to train, evaluate and optimize it with TensorFlow.

This is a part-by-part course which we will cover from basics to implementing models in productions.


Today’s TensorFlow tutorial for beginners will introduce you to performing deep learning in an interactive way:


You’ll first learn more about tensors;

Then, the tutorial you’ll briefly go over some of the ways that you can install TensorFlow on your system so that you’re able to get started and load data in your workspace;

After this, you’ll go over some of the TensorFlow basics: you’ll see how you can easily get started with simple computations.




What is TensorFlow?

TensorFlow is a popular open source library that's used for implementing machine learning and deep learning.

It was initially built at Google for internal consumption and was released publicly on November 9, 2015.

Since then, TensorFlow has been extensively used to develop machine learning and deep learning models in several business …