How to check Azure VM Power state using PowerShell?

Chirag Nagrekar
Published on 01-Mar-2021 14:52:51
To check if the VMs are running, deallocated, or stopped using PowerShell, we need to use the - Status parameter.If you write only the Get-AzVM command to get the VM details, it won’t show up the Azure VM power status default.ExampleTo check the Azure VM Power Status, Get-AzVM -statusOutput The above ... Read More

How to get the list of shared folders using PowerShell?

Chirag Nagrekar
Published on 01-Mar-2021 14:49:30
Get-SmbShare gives all the shared folders on the local system.PS C:\Temp> Get-SmbShare Name    ScopeName    Path       Description ----    ---------    ----       ----------- ADMIN$    *       C:\Windows    Remote Admin C$        *       C:\ Default ... Read More

How to get the Shared folder permissions with PowerShell?

Chirag Nagrekar
Published on 01-Mar-2021 14:44:54
To get the shared folder permissions using PowerShell, we can use the Get-SmbShare cmdlet.For example, we have a shared folder name DSC and we need to retrieve its permissions, we can use the below command.CommandGet-SmbShare -Name DSCOutputName ScopeName Path Description ---- --------- ---- ----------- DSC       *   E:\DSCIt doesn’t ... Read More

How to change SMB shared folder access permission using PowerShell?

Chirag Nagrekar
Published on 01-Mar-2021 14:41:42
We can use the command Grant-SmbShareAccess to change the shared folder access permission or to assign the new user to the shared folder with permission.In this example, we have already shared a folder name called “Shared Folder” and everyone's user permission is assigned with the read access and we will change ... Read More

How to remove windows folder sharing using PowerShell?

Chirag Nagrekar
Published on 01-Mar-2021 14:38:48
To remove the windows folder sharing using PowerShell, we can use the Remove-Smbshare command. For example, PS C:\Temp> Remove-SmbShare -Name DSC Confirm Are you sure you want to perform this action? Performing operation 'Remove-Share' on Target '*, DSC'. [Y] Yes [A] Yes to All [N] No [L] No to All ... Read More

How to share a windows folder using PowerShell?

Chirag Nagrekar
Published on 01-Mar-2021 14:35:52
To share a windows folder using PowerShell, we can use the New-SmbShare command. This command is a part of the module SmbShare.In this example, we have a folder called “DSC” and we want to share. The below command will simply share folderNew-SmbShare -Path E:\DSC\ -Name "Shared Folder"OutputName       ... Read More

How to update the specific node of the XML file using PowerShell?

Chirag Nagrekar
Published on 01-Mar-2021 14:31:29
To update the specific XML node using PowerShell, we first need to select that node with the attribute with SelectSingleNode() method.We have below the XML file from the link stored in SampleXml.XML on C:\Temp location.https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms762271(v=vs.85)In this example, we are going to update Autor and Genre properties of the Book having attribute Id = ‘bk102’$xml=[xml](Get-Content ... Read More

How to delete the specific node from the XML file using PowerShell?

Chirag Nagrekar
Published on 01-Mar-2021 14:29:03
To delete the specific XML node from the PowerShell, we can use the RemoveChild() method of the XML.For example, We have a sample XML file from Microsoft.https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms762271(v=vs.85)We have saved the above file into C:\Temp\SampleXml.XML and we need to delete the book node with attribute ‘bk102’ and for that, we will ... Read More

How to add an attribute to the XML file using Powershell?

Chirag Nagrekar
Published on 01-Mar-2021 14:25:34
To add the attribute to the XML, we first need to add the Element and then we will add an attribute for it.Below is a sample of the XML file.Example<?xml version="1.0"?> <catalog>    <book id="bk101">       <author>Gambardella, Matthew</author>       <title>XML Developer's Guide</title>       <genre>Computer</genre> ... Read More

Python Pandas – How to use Pandas DataFrame tail( ) function

Vani Nalliappan
Published on 27-Feb-2021 15:19:15
Write a Python code to find price column value between 30000 to 70000 and print the id and product columns of the last three rows from the products.csv file.Download the products.csv file here.Result for price column value between 30000 to 70000 and id and product columns last three rows are −  ... Read More
1 2 3 4 5 6 7 ... 4563 Next
Advertisements