An example comparable to your described situation exists in the documentation for Get-ADGroupMember - Example 1, located towards the bottom of the page. In this example, we are getting the groups members of all domain local groups in the AD LDS instance:
get-adgroup -server localhost:60000 -filter {GroupScope -eq "DomainLocal"} -SearchBase "DC=AppNC" |
get-adgroupmember -partition "DC=AppNC"
Notice how -Searchbase is a parameter of Get-ADGroup instead of Get-ADGroupMember -- this allows you to get your group once in Get-ADGroup and simply pipe it into Get-ADGroupMember. Piping from variables or other functions is fairly common in powershell, and useful because it keeps your operations separate and (in the case of variables) allows you to reuse results.