EM9190 Working with ESim Profiles and switching WinRT

Can anyone direct me to a minimal reproducible example of how to access the esim and search through its profiles to see which one is enabled and change the profiles? As well as other examples using WinRT on windows. Thank you.

See if this helps

I know you can do it through the settings. I wanted a way to do it programmatically, preferably using winRT api for windows.

i asked the AI, it gave me the following sample code:

#include <winrt/Windows.Networking.NetworkOperators.h>
#include <winrt/Windows.Foundation.h>
#include <iostream>

using namespace winrt;
using namespace Windows::Networking::NetworkOperators;

void Added_esim(ESimWatcher const& sender, ESimAddedEventArgs const& args) {
    auto esim = args.ESim();
    std::wcout << L"eSIM EID: " << esim.Eid().c_str() << std::endl;
}

int main() {
    init_apartment();

    auto esimWatcher = ESimManager::TryCreateESimWatcher();
    if (!esimWatcher) {
        std::wcerr << L"Failed to create ESimWatcher. Check app permissions." << std::endl;
        return -1;
    }

    esimWatcher.Added(Added_esim);
    esimWatcher.Start();

    std::wcout << L"Watching for eSIMs..." << std::endl;
    std::cin.get(); // Keep the app running

    return 0;
}

Maybe you can also see this: