supertux
Goto Top

AppID in Variable

Hallo,

leider kenne ich mich nicht mit Powershell aus, kann hier jemand helfen?
Wie bekomme ich die AppID in eine Variable.

Get-StartApps | where name -like "*Excel*"

Name AppID
-----
Excel Microsoft.Office.EXCEL.EXE.15

Vielen Dank

Gruß supertux

Content-ID: 622421

Url: https://administrator.de/forum/appid-in-variable-622421.html

Ausgedruckt am: 20.04.2025 um 20:04 Uhr

mayho33
mayho33 15.11.2020 aktualisiert um 02:09:03 Uhr
Goto Top
Ganz einfach:

$meineVariable = Get-StartApps | where name -like "*Excel*"  


Nachdem du aber ein Object mit mehreren Properies zurück bekommst, musst du wohl so vorgehen:

$meineVariable = Get-StartApps | where-Object {$_.name -like "*Excel*" }  

Grüße!
supertux
supertux 15.11.2020 um 10:14:33 Uhr
Goto Top
Hallo,

da die Ausgabe zwei Spalten hat, möchte ich nur die APPID Microsoft.Office.EXCEL.EXE.15 in der Variable haben.
Kann man das noch trennen?

Vielen Dank im voraus

Gruß supertux
Daemmerung
Daemmerung 15.11.2020 aktualisiert um 11:47:56 Uhr
Goto Top
Du musst auf die Eigenschaft zugreifen und diese entsprechend zuweisen:

$meineVariable = (Get-StartApps | where name -like "*Excel*").AppID