param( [ValidateSet('List','Update','Auto','All')] [string]$Mode = 'List' ) $script:yayCli = "cat /run/check.yay.updates/list" switch( $Mode ){ 'Update' { $yayCli = "yay -Syu --needed --ignore docker,linux,linux-api-headers,linux-firmware,linux-headers,zfs-linux,zfs-utils" } 'Auto' { $yayCli = "yay -Syu --needed --noconfirm --ignore docker || yay -Syu --needed --ignore docker,linux,linux-api-headers,linux-firmware,linux-headers,zfs-linux,zfs-utils --noconfirm" } 'All' { $yayCli = "yay -Syu --needed" } } & sh "-c" "$yayCli" -replace '#args',"$args"