Functions/Enable-NFS.ps1


function Enable-NFS {
    [CmdletBinding()]
    param (
        # [Parameter()] [string] $ParameterName
    )


    Enable-WindowsOptionalFeature -Online -FeatureName ServicesForNFS-ClientOnly
    Enable-WindowsOptionalFeature -Online -FeatureName ClientForNFS-Infrastructure
    Enable-WindowsOptionalFeature -Online -FeatureName NFS-Administration


    New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default" -Name AnonymousUid -Value 0 -Type DWORD
    New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default" -Name AnonymousGid -Value 0 -Type DWORD


    nfsadmin client stop
    nfsadmin client start

    nfsadmin client localhost config fileaccess=755 SecFlavors=+sys -krb5 -krb5i

}