Export/import WLAN profiles in Windows

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=all But this command only works with a specific xml file The script needs to work on 11 and 10 Windows.

Well the netsh wlan show profiles command will dump all the profiles, so you can parse all the names into an array. Then dump each into an xml file. Copy the xml files to the target system (w/powershell). Then you would get all profile files (Get-ChildItem) look through and for each file call your netsh wlan add profile filename=$File...