# Programatically deprecating SharePoint Terms
Happy Pi day! As a follow up to last weeks [post](/post/termstore) on managing the SharePoint term store using PowerShell and a SharePoint list, my [pull request](https://github.com/pnp/powershell/pull/367) was accepted and made it into version 1.4.0 of [PnP.Powershell](https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-pnp/sharepoint-pnp-cmdlets?view=sharepoint-ps).

That means you can now (un)deprecate terms in the store using the new `-deprecated` parameter on [Set-PnPTerm](https://github.com/pnp/powershell/blob/dev/documentation/Set-PnPTerm.md).

In our implemnentation we use a boolean (yes/no) column called 'Active' in the source SharePoint list. This conditional then sets the deprecation state:

{{< highlight powershell "linenos=table" >}}
if($item.FieldValues["Active"] -eq "Yes"){
	$t = Set-PnPTerm -Identity $termGUID -deprecated $false 
		-TermSet $destTermSet -TermGroup "GroupName"
	Write-Verbose -Message "Undeprecated Term: $($item.FieldValues.Title)"
} else {
	$t = Set-PnPTerm -Identity $termGUID -deprecated $true 
		-TermSet $destTermSet -TermGroup "GroupName"
	Write-Verbose -Message "Deprecated Term: $($item.FieldValues.Title)"
}
{{< / highlight >}}

All that's remaining is to be able to move terms. I have some code for that, but there are a lot of edge cases that still require more testing.
