Police have shot a man who allegedly lunged towards officers with a knife as they responded to a robbery in Gosnells.