# [Record] How to enable wireless projection between two laptops in win 10/11
###### tags: `windows`, `win10`, `win11` `screen mirroring`, `screen extending`, `wireless display`
[toc]
## Scenario
I have two laptops and no monitor at hand, and I want to extend my screen to improve my work efficiency. To make it, I have to install and enable Wireless Display in Win 10/11.
## Wireless projection technology
In windows, there are two ways:
1. Wireless Projection using Miracast
2. **Wireless Projection over an existing Wi-Fi network**
> It has been observed that in 90% of cases, when a User starts a Wireless Projection stream, the device they are using is already connected to an existing Wi-Fi network, either in a home or a business. In response to this, Microsoft has extended the ability to send a Miracast stream over a local network rather than over a direct wireless link in the Windows 10 Creators Update.
## Install wireless display feature
There are two methods to install wireless display in win 10/11.
- GUI
- CLI
Here, I only show how to install it through CLI in Windows PowerShell.
:::info
We have to install this feature on both laptops.
:::
1. **Run Windows PowerShell** as adminstrator


2. **Check** the wireless display feature
```bash
PS C:\Windows\system32> DISM /Online /Get-Capabilities | Select-String -Pattern 'wireless'
Capability Identity : App.WirelessDisplay.Connect~~~~0.0.1.0
PS C:\Windows\system32> Get-WindowsCapability -Online | Where-Object Name -like 'APP.WirelessDisplay*'
Name : App.WirelessDisplay.Connect~~~~0.0.1.0
State : NotPresent
```
3. **Install** it
- In **Win 11**
- Edition: Windows 11 Home
- Version: 21H2
- OS build: 22000.1335
```bash
PS C:\Windows\system32> DISM /Online /Add-Capability /CapabilityName:App.WirelessDisplay.Connect~~~~0.0.1.0
Deployment Image Servicing and Management tool
Version: 10.0.22000.653
Image Version: 10.0.22000.1335
[==========================100.0%==========================]
The operation completed successfully.
```
- In **Win 10**
- Edition: Windows 10 Pro
- Version: 21H2
- OS build: 19044.2251
```bash
PS C:\Windows\system32> DISM /Online /Add-Capability /CapabilityName:App.WirelessDisplay.Connect~~~~0.0.1.0
Deployment Image Servicing and Management tool
Version: 10.0.19041.844
Image Version: 10.0.19043.2251
[==========================100.0%==========================]
The operation completed successfully.
```
4. Enable it
I have two laptops A and B at hand, and I work on A and want to extend A's monitor to B's. Here, we can regard A as a master and B as a slave.
:::info
Both A and B have to connect to the same WiFi AP in advance.
:::
- First, on slave B, we have to open the **Connect App**.


- Secnod, on master A, we can press Windowslogo key + K to find availabe displays.

- Third, on master A, click "Slave B" to connect to it.

- Finally, on master A, you can press Windowslogo key + P to change the projection mode.

- Besides, on master A, not only the monitor is extended to slave B, the speakers can also be mirror to slave B as shown below.

## Reference
https://learn.microsoft.com/zh-tw/windows-hardware/design/device-experiences/wireless-projection-understanding
https://www.thewindowsclub.com/add-and-remove-wireless-display-feature-in-windows-10
https://support.microsoft.com/en-us/windows/screen-mirroring-and-projecting-to-your-pc-5af9f371-c704-1c7f-8f0d-fa607551d09c#ID0EBD=Windows_10
https://www.delftstack.com/zh-tw/howto/powershell/powershell-grep/