To install windows features on the server, Install-WindowsFeature cmdlet is used .Install-WindowsFeature Windows-Server-Backup -LogPath C:\Temp\Installfeatures.txt -VerboseIn the above example, Windows-Server-Backup feature will be installed on the local server and logs will be stored at location C:\Temp and file name InstallFeatures.txt.PS C:\Users\Administrator> Install-WindowsFeature Windows-Server-Backup -LogPath C:\Temp\Installfeatures.txt -Verbose VERBOSE: Installation started... VERBOSE: Continue with installation? VERBOSE: Prerequisite processing started... VERBOSE: Prerequisite processing succeeded. Success Restart Needed Exit Code Feature Result ------- -------------- --------- -------------- True No Success {Windows Server Backup} VERBOSE: Installation succeeded.You can also install the feature with the pipeline command, Get-WindowsFeature Windows-server-backup | Install-WindowsFeature -LogPath C:\Temp\Installfeatures.txt -VerboseIf your windows feature ... Read More
To get the windows features and roles available or installed using PowerShell, you need to use the Get-WIndowsFeature cmdlet. That is obvious that Windows features and roles are available only on the server operating systems not on the client operating system.When you run the Get-WindowsFeature on the server operating system from Windows server 2008 onwards using PowerShell, you will get the output as below.The crossed symbol in the square box indicates that the feature is installed. You can also check the same using ‘Install State’. To get only Installed features on the server, you need to filter out the Install ... Read More
A python tuple is ordered and unchangeable. But it can also be made up of lists as its elements. Given a tuple made up of lists, let’s find out how many lists are present in the tuple.with len()In this approach we will apply the len function. The len() function will give the count of lists which are the elements of the tuple.Example Live DemotupA = (['a', 'b', 'x'], [21, 19]) tupB = (['n', 'm'], ['z', 'y', 'x'], [3, 7, 89]) print("The number of lists in tupA :" , len(tupA)) print("The number of lists in tupB :" , len(tupB))OutputRunning the above ... Read More
Given a list with sorted numbers, we want to find out which numbers are missing from the given range of numbers.With rangewe can design a for loop to check for the range of numbers and use an if condition with the not in operator to check for the missing elements.Example Live DemolistA = [1, 5, 6, 7, 11, 14] # Original list print("Given list : ", listA) # using range res = [x for x in range(listA[0], listA[-1]+1) if x not in listA] # ... Read More
If we have a list containing numbers, we can check if the numbers are contiguous or not and also find which numbers are missing from a range of numbers considering the highest number as the final value.With range and maxWe can design a for loop to check for absence of values in a range using the not in operator. Then capture all these values by adding them to a new list which becomes the result set.Example Live DemolistA = [1, 5, 6, 7, 11, 14] # Original list print("Given list : ", listA) # using range and max res ... Read More
Sometimes we may need to compare elements in two python lists in terms of both their value and position or index. In this article we will see how to find out the elements in two lists at the same position which do not match in their value.Using for loopwe can design for loop to compare the values at similar indexes. Id the values do not match then we add the index to a result list. The for loop first fetches the value in the first index and then uses an if condition to compare it with values from the second ... Read More
A python list can contain both strings and numbers. We call it a heterogeneous list. In this article we will take such a list and find the minimum and maximum number present in the list.Finding MinimumIn this approach we will take the isinstance function to find only the integers present in the list and then apply the min function to get the minimum value out of it.Example Live DemolistA = [12, 'Sun', 39, 5, 'Wed', 'Thus'] # Given list print("The Given list : ", listA) res = min(i for i in listA if isinstance(i, int)) # Result print("The ... Read More
Numpy is a very powerful python library for numerical data processing. It mostly takes in the data in form of arrays and applies various functions including statistical functions to get the result out of the array. In this article we will see how to get the mean value of a given array.with meanThe mean function can take in an array and give the mathematical mean value of all the elements in it. So we design a for loop to keep track of the length of the input and go through each array calculating its mean.Example Live Demoimport numpy as np ... Read More
Data analysis can throw a variety of challenges. In this article we will take a list with numbers as its elements. Then we will find such pairs of elements in the list which has maximum difference in value between them.With nlargestThe approach here is to first find out all possible combinations of elements and then subtract the second element from the first. Finally apply the nlargest function form heapq module to get those pairs where the difference is maximum.Example Live Demofrom itertools import combinations from heapq import nlargest listA = [21, 14, 30, 11, 17, 18] # Given list ... Read More
A given string may be a mixture of digits and letters. In this article we are required to find the biggest substring that has letters and digits together.with re moduleThe regular expression module can be used to find all the continuous substring having digits or letters. Then we apply the max function to pick only those continuous substrings of letters and digits which have maximum length among all the substrings found. The findall function is also use to identify and get the required substrings.Example Live Demoimport re def longSubstring(str): letter = max(re.findall(r'\D+', str), key=len) digit = max(re.findall(r'\d+', str), ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP