powershell – disable “sharewith” from the Ribbon and share option in sharepoint 2019

I need to disable ” Shared With” from the ribon and the share of an item for all users:

enter image description here

enter image description here

I used those two powershell ligne but that dosent work:

Disable-SPFeature -Identity "FollowingContent" -URL $web

and

$web.RequestAccessEmail=""

i checked the $web.RequestAccessEnabled= false

Any idea