Tag: cmd

netsh wireless password

Show Wireless Network Password on Windows 10

Today I have a simple blog post, which is more less just a note for myself. If you are join your Windows 10 device to a Wireless Network and you can’t remember the Wireless Password or Key you can recover this using the netsh command. Simply run this command to show the network key of the wireless network:

To list the wireless networks you have access to, you can use the following command:



Azure Cloud Shell

Azure Cloud Shell – shell.azure.com and in Visual Studio Code

Back in May Microsoft made the Azure Cloud Shell available in the Microsoft Azure Portal. Now you can use it even quicker by just go to shell.azure.com. First you login with your Microsoft account or Work and School account, and if your account is in multiple Azure Active Directory tenants, you select the right tenant and you will be automatically logged in. So even if you are on a PC where you can not install the Azure CLI or the Azure PowerShell module, you can still easily fire up a shell where you can run the Azure CLI, Azure PowerShell and other CLI tools like Docker, Kubectl, emacs, vim, nano, git and more.

In addition you can also open up Azure Cloud Shell directly from Visual Studio Code

Azure Cloud Shell Visual Studio Code

With that, enjoy your holidays and I wish you a good start in the new year!



Tar and Curl on Windows 10

Today Microsoft released Windows 10 Insider Preview Build 17063 which includes a lot of great new features like Timeline, Activities, Microsoft Edge, Windows Subsystem for Linux improvements and much more. But Microsoft also included something for IT Pros and Developers. After the OpenSSH client and the OpenSSH server. Microsoft brings two new command-line tools for the Windows toolchain: curl and bsdtar. These tools are very well known tools in the open source world. Including them in Windows should make Windows even a better development platform.

 

Tar on Windows 10
Tar: A command line tool that allows a user to extract files and create archives. Outside of PowerShell or the installation of third party software, there was no way to extract a file from cmd.exe. We’re correcting this behavior 🙂 The implementation we’re shipping in Windows uses libarchive.

curl on Windows 10

Curl: Another command line tool that allows for transferring of files to and from servers (so you can, say, now download a file from the internet).

Why this, so first of all you have PowerShell which has similar functionality, but PowerShell is not always available (Think about Nano Server container images where you have not the Full .Net Framework available). Secondly Developers which come from other operating systems are already familiar with these tools and they can use, as they would on their “old” operating system.

If you want to know more, check out Craig Wihite’s (Microsoft) blog post: Tar and Curl Come to Windows!

As mentioned this is included in the Windows 10 Insider Preview Build 17063 and should ship to production customers in the next Windows 10 release, which might be Windows 10 (1803).



cmd clip

Pipe cmd prompt commands into the clipboard

This is a very all but very useful command if you work with the Windows Command Prompt. This allows you to output text from commands into the Windows clipboard.

Scott Hanselman from Microsoft just reminded the community about this feature, which is available in Windows since Windows Vista.

PowerShell v5 got some similar command using Set-Clipboard and Get-Clipboard.



Transparent PowerShell Background in Windows 10

Transparent PowerShell Background in Windows 10

After some recent blog post, where I posted some screenshots of my PowerShell console, some people were asking about how I made the background of the PowerShell console transparent. Well this is very simple, Microsoft changes a lot on the Command Prompt and PowerShell in Windows 10.

Simply right click on the title bar of the PowerShell console or CMD console and click on properties.

PowerShell Options

Now in the Colors tap you can change the transparency of the console window using the opacity slider.

Transparent PowerShell Background in Windows 10

This also works with the command prompt (CMD) on Windows 10.



Replace Diskpart with Windows PowerShell – Basic Storage cmdlets

Windows Server 8

Last week I made a blog post about how you can create a USB drive for Windows To Go. In my post I used diskpart.exe to format the USB drive. Now we don’t live in the stone age anymore, so I did the same with the new version of Windows PowerShell coming in Windows 8 and Windows Server 8.

Now here some basic cmdlets to do some simple storage operations, like clean a disk, create a partition and so on.

Lets start simple

List all disks

get-disk

Now get all partitions

get-partition

Now get all partitions of disk 0

get-partitiondisk

Clear a Disk

clear-disk

Create a new partition

new-partition

Format this volume

format-volume

Create new partition and format it with the label “USB”:

format-volume1

Change driveletter

set-partition

Set a partition active

set-partition1

Remove a partition

remove-partition

Bring a disk online

Remove Readonly flag

Initialize Disk with GPT

online disk

This is some basic knowledge about the storage module in PowerShell v3. Lets see how we can change the commands from using diskpart to Windows PowerShell.

Diskpart.exe

PowerShell:

replace-diskpart



Windows Server Core

Commands for Windows Server Core & Hyper-V Server

For some KTSI projects I have been working a lot with Windows Server Core or Hyper-V Server. Now I had to do a lot of automation, so I made this little connection of commands. If you configure the server manually you can do the most important things with the sconfig utility.

Windows Server Core

Networking

Set Hostname

Join Domain

Remove Domain

Rename Network Interface

Configure IP Address

Configure DNS Servers

Disable Firewall (not recommended)

 

Remoting

Enable PowerShell Remoting

Enable Remotedesktop

Enable Remote Administration

Enable Remote Firewall Administration

Enable ICMP (Ping)

Enable Remote Disk Management

 

Licensing

Enter License key

Activate Windows

 

Windows Update

Enable automatic updates

Disable automatic updates

 

Roles & Features

Get availibale features & roles

Enable feature & roles

 

Basics

Change Administrator password

Restart Computer

Logoff

More information about Server Core: TechNet