Dismount ISO File Using PowerShell

Chirag Nagrekar
Updated on 25-Jan-2021 07:25:55

4K+ Views

To dismount the ISO file on the Windows Server using PowerShell, we need to use the Dismount−DiskImage command. When you use this command, you need to use the same path used for mounting the disk image.In this example, we have a disk mounted on E: on the local server, that we can check using the windows explorer or cmdlets.We have the source ISO image stored at F: drive, so we can dismount the image using the below command.ISO Disk will be mounted from the E:To dismount the disk on the remote server, we can use the CIMSession command.$sess = New−CimSession ... Read More

Python Data Visualization Using Bokeh

Pradeep Elance
Updated on 25-Jan-2021 07:25:18

305 Views

Bokeh is an python data visualization library for web browsers. It czncreate elegant, concise construction of versatile graphics. It is used to quickly and easily make interactive plots, dashboards, and data applications. In this article we will see how we can create various types of basic graphs using Bokeh.Plotting LinesWe can create a line plot by using the x and y coordinates of the points in it as two lists. We directly display the output in the browser by specifying the height and width of the figure. We can also supply additional parameters like width of the line and colour ... Read More

Format Disk Using PowerShell

Chirag Nagrekar
Updated on 25-Jan-2021 07:23:31

1K+ Views

To format the disk using PowerShell, we can use the Format−Volume command. For example, we have to format the E: on the local server then we can use the simple format command as shown below.Format−Volume −DriveLetter E −Force −VerboseTo format the disk with the specific filesystem use the below command.Format−Volume −DriveLetter E −FileSystem NTFS −Full −Force −VerboseThe above command with Format the E drive with the NTFS file system (there are other file systems like FAT, FAT32, exFAT) forcefully.You can even change the label for the drive while formatting using −NewFileSystemLabel command.Format−Volume −DriveLetter E −FileSystem NTFS −NewFileSystemLabel "Temporary Stroage" −Full ... Read More

Change Local Disk Name Using PowerShell

Chirag Nagrekar
Updated on 25-Jan-2021 07:23:14

4K+ Views

To change the local disk name using PowerShell, we can use the Set−Volume command. For example, we have Drive name F and its volume label is “New Volume” and need to change it to the “Temporary Storage” then we can change the label using its existing volume name or with the Drive letter.To change the volume name with the Drive letter, Set−Volume −DriveLetter 'E' −NewFileSystemLabel 'Temporary Storage'To change it with the existing label, Set−Volume −FileSystemLabel 'New Volume' −NewFileSystemLabel 'Temporary Storage'For the remote system, we can use either Invoke−Command or the CIMSession parameter.For example, $sess = New−CimSession −ComputerName Labmachine2k12 Set−Volume −CimSession ... Read More

Create Test Datasets Using Scikit-Learn in Python

Pradeep Elance
Updated on 25-Jan-2021 07:19:19

373 Views

The Sklearn python library does provide sample data sets which can be used tocreate various graph plots. The usefulness of these datasets is in creating sample graphs and charts and predicting the behavior of the graph as the values changes. Also you can work on other parameters like deciding on the colours and axes etc on this sample graphs before using the actual data set.Using make_blobsIn the below example we use the sklearn library along with the matplotlib to create a scatter plot with a specific style. We choose a sample of 200 data points and also select the colour ... Read More

Install NuGet Package Using PowerShell

Chirag Nagrekar
Updated on 25-Jan-2021 07:18:40

21K+ Views

Nuget is the package management tool for the .NET and it is similar to PowerShellGet, MSI packages which support several commands and packages to work with PowerShell.NuGet supports Install−Package, Update−Package, Find-Package, and Get−Package command and if Nuget package is not installed in your system, you may not find a package or install any package.For more reference about Nuget, check the websites below.https://www.nuget.orghttps://docs.microsoft.com/en-us/nuget/reference/powershellTo install NuGet, we need to use the Install−PackageProvider command. Use the below command to install the Nuget package.Install−PackageProvider −Name Nuget −ForceOn some machines, you will get the error message regarding downloading the package from the internet. If you ... Read More

Find Maximum Length Sub-List in a Nested List in Python

Pradeep Elance
Updated on 25-Jan-2021 07:18:06

975 Views

we often deal with nested lists when doing data analysis in python. In this article, we will see how to find out the longest list among the elements in a nested list and then print this along with its length.Using lambda and mapWe declare a nested list and give it as input to the lambda function along with its length. Finally, we apply the max function to get the list with maximum length as well as the length of such list.Example Live Demodef longest(lst):    longestList = max(lst, key = lambda i: len(i))    maxLength = max(map(len, listA))    return longestList, ... Read More

Change Drive Letter Using PowerShell

Chirag Nagrekar
Updated on 25-Jan-2021 07:15:34

2K+ Views

To change the drive letter using PowerShell, we can use the Set−Partition command but before that, we need to know which drive letter to change. You can check the drive letter using Windows Explorer, Get−Partition, Gwmi win32_Logicaldisk, or Get−CimInstance Win32_Logicaldisk command.Suppose we have an E: and we need to rename its drive letter to F, so we can use the below command.Set−Partition −DriveLetter 'E' −NewDriveLetter 'F'Make sure that the drive is not in use by Pagefile, open application, or open file from the drive otherwise the drive letter will fail to change.To change the drive letter on the remote computer, ... Read More

Get Disk Information Using PowerShell

Chirag Nagrekar
Updated on 25-Jan-2021 07:15:06

7K+ Views

To get the Windows disk information using PowerShell, we can use the WMI command or the CIM class command.With the WMI command, Gwmi Win32_LogicalDiskWith the CIM instance method, Get−CimInstance Win32_LogicalDisk You can see both the outputs are identical. Let’s use one of them.DeviceID DriveType ProviderName VolumeName Size FreeSpace -------- --------- ------------ ---------- ---- --------- C: 3 53317988352 44027125760 D: 5 HRM_SSS_X64FREE_EN-US_DV5 3694962688 0 E: 3 Temporary Storage 10734268416 10238513152Now there are different drive types associated with Windows and they each have an identical number. For example, Drive Type ‘3’ mentions the logical disk. The other types are as below.2 = ... Read More

Creating a Proxy Webserver in Python

Pradeep Elance
Updated on 25-Jan-2021 07:14:41

2K+ Views

A proxy server sits in between the client and the actual server. It receives the requests from the client, send it to the actual server, and on receiving the response from the actual server it sends the response back to the client. There are many reasons to use the proxy like hiding the server’s IP address, performance improvement or increasing security etc. In this article we will see how we can create a simple proxy server using python.The three modules SimpleWebSocketServer, , SimpleHTTPSServer and urllib can be used to achieve this. Below we see how we create python class using ... Read More

Advertisements