Yes, it is possible. You could use the following example.
$rgName = "shuilinux"
$nicName = "shui648"
$pipName = "shui-ip"
##unattach public IP on nic
$nic = Get-AzureRmNetworkInterface -ResourceGroupName $rgName -Name $nicName
$nic.IpConfigurations.PublicIpAddress.Id=""
$nic|Set-AzureRmNetworkInterface
##attach public IP to a nic
##If you want to create a new Public IP, use $pip = New-AzureRmPublicIpAddress -Name $pipName -ResourceGroupName $rgName -Location $locName -AllocationMethod Dynamic -Force
$pip = Get-AzureRmPublicIpAddress -Name $pipName -ResourceGroupName $rgName
$nic = Get-AzureRmNetworkInterface -ResourceGroupName $rgName -Name $nicName
$nic.IpConfigurations[0].PublicIpAddress = $pip
Set-AzureRmNetworkInterface -NetworkInterface $nic