Changing post-processing profile via scripting

Can somebody tell me how I could change the profile of the unity’s post-processing stack, via scripting. For example, when I press F I want to switch from normal camera profile to nightvision profile.

public PostProcessingProfile nightvisionProfile;

void Update () {
  if(Input.GetKeyDown(KeyCode.F)) {
    ppp = GetComponent<PostProcessingBehaviour>().profile = nightvisionProfile;

Updating the answer:

using UnityEngine.Rendering.PostProcessing;     

public PostProcessingProfile profile;
Camera.main.GetComponent<PostProcessVolume>().profile = profile;