Coder Social home page Coder Social logo

Comments (5)

mardahl avatar mardahl commented on August 16, 2024

Could you give some code examples?
Thanks

from edgeprofiles.

htcfreek avatar htcfreek commented on August 16, 2024

I planned to upload an complete ps script. But it will take time. On wednesday I might get access to the working script.

But you can find the reg keys and shortcuts (user startmenu and user desktop) by the property of uninstall/destination path. It's edge_proxy.exe or something similar. For getting the shortcut destination you need the shell com object feature.

from edgeprofiles.

htcfreek avatar htcfreek commented on August 16, 2024

https://www.reddit.com/r/AskGreg/comments/2k0siw/powershell_get_shortcut_target/

from edgeprofiles.

mardahl avatar mardahl commented on August 16, 2024

I can backup the PWA shortcuts with this bit of code:

#function to aquire the users PWA shortcuts from the userprofile
function Get-EdgePWAShortcuts{
    #Get all shortcuts from the userprofile and collect in array
    $Shortcuts = Get-ChildItem -ErrorAction SilentlyContinue -Recurse $($env:USERPROFILE) -Include *.lnk
    #Create shell object to analyse shortcut details
    $Shell = New-Object -ComObject WScript.Shell
    foreach ($Shortcut in $Shortcuts)
    {
        #Check if the shortcut is Edge based on the target path (this should be the PWA app)
        if ($Shell.CreateShortcut($Shortcut).targetpath -like "*edge_proxy.exe") {
            $Properties = @{
                ShortcutName = $Shortcut.Name;
                Path = $Shortcut.FullName;
                ShortcutDirectory = $shortcut.DirectoryName
                Target = $Shell.CreateShortcut($Shortcut).targetpath
            }
            #output the shortcut details as a PSObject
            New-Object PSObject -Property $Properties
        }
    }
    #Release the shell object
    [Runtime.InteropServices.Marshal]::ReleaseComObject($Shell) | Out-Null
}

But I don't see how it makes a difference without the registry, which I am not seeing any good docs on how to couple with the PWA shortcuts that have some references in : Computer\HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Mappings

Now I donøt use these PWA, so I won't be a good tester.

Could you perhaps suggest some more code logic if you want this feature added?

from edgeprofiles.

htcfreek avatar htcfreek commented on August 16, 2024

I can't help you with this. As some things have changed and my old solution doesn't work anymore, I have removed it.

from edgeprofiles.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.