Portia says, in part, the following to Nerissa:
... O me, the word 'choose!' I may
neither choose whom I would nor refuse whom I
dislike; so is the will of a living daughter curbed
by the will of a dead father. Is it not hard,
Nerissa, that I cannot choose one nor refuse none?
The pun is on the word, 'will.' Portia means that her father's will - a legal document in which a testator leaves a bequest or an estate to an heir or heirs - restricts her own will. In her instance, will refers to her desire. Her father's testament (synonym for will) forbids her to choose a husband. If she wishes to become the sole owner of her father's deceased estate, she has to meet the conditions of his will.
It is clear that Portia's father wished to rule his daughter from the grave. His will states that she should only marry the man who chooses the right casket from three: gold, silver or lead. She has no choice in the matter and cannot assist a suitor who wishes to take a chance. If she should do so, her inheritance is forfeit.
Portia has no affection for any of her suitors, except one, Bassanio, who has not yet arrived at this point. She is much displeased with the current collection of visitors and is quite critical of, for example, their bad manners and poor dress sense. The poor girl is quite flustered but has decided to respect her father's wishes. In fact, she has to whether she likes it or not if she wishes to be an heiress.