Found 989 Articles for Software & Coding

How to get the Azure VM virtual Network and the Subnet name using PowerShell?

Chirag Nagrekar
Updated on 01-Sep-2021 09:51:41

2K+ Views

To retrieve the Azure VM virtual network and subnet name, we first need to retrieve the AzureVM NIC information. To get the Azure VM NIC information, we need to use the Get-AzVM command, and then we can use the NetworkProfile property to retrieve the NIC name as shown below.PS C:\> $vm = Get-AzVM -Name TestVM $vmnic = ($vm.NetworkProfile.NetworkInterfaces.id).Split('/')[-1]Once we have the NIC name stored from the above command in the $vmnic variable, we can retrieve the NIC information using the Get-AzNetworkInterface command as shown below.$vmnicinfo = Get-AzNetworkInterface -Name $vmnicTo get the Virtual Network name attached to the VM use the ... Read More

How to retrieve the Azure subnets connected to the virtual network using PowerShell?

Chirag Nagrekar
Updated on 31-Aug-2021 09:38:11

2K+ Views

To get all the subnets attached to the virtual network using PowerShell, we need to use the GetAzVirtualNetwork command.PS C:\> $vn = Get-AzVirtualNetwork -Name VirtualNetworkNameTo get the Subnets and its address prefix details, you need to filter out the Subnets and AddressPrefixPS C:\> $vn.Subnets | Select Name, AddressPrefix

How out-gridview selection works in PowerShell?

Chirag Nagrekar
Updated on 01-Sep-2021 09:28:50

1K+ Views

With the PowerShell Out-Gridview output, you have an option to select one or multiple selections.For example, if we run the below command, it will show us the output in the grid format.PS C:\> Get-Process | Out-GridViewIn this output, you don’t get any option to select the rows because its output mode is none. To add the single selection from the output, use the Output mode to single, and for the multiple selections use the output mode to multiple. Once you add the OutpuMode property you can see the OK and Cancel button at the bottom right of the grid.Single output ... Read More

How to find the file modified after a certain date using PowerShell?

Chirag Nagrekar
Updated on 31-Aug-2021 08:48:36

15K+ Views

To get all the files that are modified after certain days, we need to use the LastWriteTime property.The below command shows us the files which are modified within the last 30 days in the C:\temp folder.Get-ChildItem C:\Temp | where{$_.LastWriteTime -ge (GetDate).AddDays(-30)}You can also use the AddMonths() or AddYears() instead of AddDays() as per your requirement.To get all the files that are modified before 30 days, use the below command.Get-ChildItem C:\Temp | where{$_.LastWriteTime -le (GetDate).AddDays(-30)}To get the file modified after a specific date, you need to compare the LastWriteTime with the Date. For example, we need all the files that are ... Read More

Deep sleep in Arduino

Yash Sanghvi
Updated on 02-Aug-2021 05:28:49

7K+ Views

The equivalent of deep sleep in Arduino would be the Power Down mode, which consumes the least power out of all the sleep modes. While this has already been covered in another article, but for the sake of completeness, here’s a brief on the sleep modes in Arduino.Arduino’s microcontroller, ATmega328P has 6 sleep modes, of which 5 are available with the avr/sleep.h library.Idle modeADC Noise ReductionPower-downPower-saveStandbyExtended StandbyEach mode has different wake-up modes and different power consumption.The Idle mode is easiest to wake up from and the Standby and Power down mode is the most difficult to wake up from (you ... Read More

Make the Arduino sleep and then wake up

Yash Sanghvi
Updated on 31-Jul-2021 13:57:47

2K+ Views

In this article, we will, as the title suggests, make the Arduino sleep, and wake it up using an interrupt. Arduino’s microcontroller, ATmega328P has 6 sleep modes, of which 5 are available with the avr/sleep.h library. Each mode has different wake-up modes and different power consumption.Arduino’s microcontroller, ATmega328P has 6 sleep modes, of which 5 are available with the avr/sleep.h library.Idle modeADC Noise ReductionPower-downPower-saveStandbyExtended StandbyEach mode has different wake-up modes and different power consumption.The Idle mode is easiest to wake up from and the Standby and Power down mode is the most difficult to wake up from (you can only ... Read More

Arduino Time Library Introduction

Yash Sanghvi
Updated on 02-Aug-2021 06:40:33

8K+ Views

The Time library provides you with timekeeping functionality on the Arduino. The latest version of the library is documented here.To install it, search for Time in the Library Manager and install the library by Michael Margolis.You’ll have to scroll a bit to find this library.Once the library is installed, if you go to File → Examples → Time, you will be able to see several examples of integrating this library with various sources: GPS, NTP, RTC, etc.The basic idea is that you can set time using the functions −setTime(hours, minutes, seconds, days, months, years);OR, setTime(t);where t is the special time_t ... Read More

Real Time Clock (RTC) with Arduino

Yash Sanghvi
Updated on 31-Jul-2021 13:48:36

2K+ Views

An RTC module keeps track of time once an initial time input is provided to it. This input can come from several sources (NTP, GPS, etc.). The RTC module usually comes with its own crystal oscillator, and even its own battery, so that the timekeeping continues, even if there is a power disturbance on the Arduino.Circuit Diagram −We will use the DS3231 module. It uses I2C for communication (SDA and SCL lines). The circuit diagram is shown below −As you can see, the Vcc pin of DS3231 is connected to 5V, GND to GND, SDA to A4 (SDA) and SCL ... Read More

Browse Arduino libraries by Category on Arduino Website

Yash Sanghvi
Updated on 02-Aug-2021 06:36:54

129 Views

Follow the steps given below to browse Arduino libraries by category on Arduino website −Go to http://arduino.cc/Click Documentation → ReferenceClick Libraries from the left menu.The libraries can now be found in the categorized form on this pageClick the category of your interest and explore the available libraries.

Goto in Arduino

Yash Sanghvi
Updated on 02-Aug-2021 06:34:22

6K+ Views

goto is a control structure in Arduino, like in C, and it is used to transfer the program flow to another point in the program. It is highly discouraged, as many programmers agree that you can write every algorithm you want without the use of goto.Excessive use of goto makes it very difficult to debug programs, or, in some cases, creates program flows which are impossible to debug. It is assumed that you will read further only if you absolutely have to use goto.SyntaxThe syntax for using goto is −goto label; label:    //statementsExampleThe following example demonstrates this −void ... Read More

Advertisements