I created a simple script that creates a ps folder on the C drive and saves there the information about the name of the wifi connection and the password from it in xml files. Currently the script looks like this
$challenge = Read-Host "Export(1) or Import(2)?"
if ($challenge -eq "1"){
try{
New-Item -Path 'C:\ps\' -ItemType Directory
netsh wlan export profile key=clear folder=c:\ps
}
}elseif ($challenge -eq "2"){
try{
}
How can I add the function to export all xml files created on the c drive and then import it on another computer? I know there is a command netsh wlan add profile netsh wlan add profile filename="c:\ps\Wireless network-Xiaomi_20F5.xml" user=al
l But this command only works with a specific xml file The script needs to work on 11 and 10 Windows.