Resources/PSNote_Classes.ps1
# Create the PSNote class class PSNote { [string]$Note [string]$Snippet [string]$Details [string]$Action [string]$Alias [string[]]$Tags [string]$file PSNote( [string]$Note, [string]$Snippet, [string]$Details, [string]$Action, [string]$Alias, [string[]]$Tags ){ $this.Note = $Note $this.Snippet = $Snippet $this.Details = $Details $this.Action = $Action $this.Alias = $Alias $this.Tags = $Tags $this.File = $script:UserPSNotesJsonFile if([string]::IsNullOrEmpty($Alias)){ $this.Alias = $Note } if([string]::IsNullOrEmpty($this.Action)){ $this.Action = 'Display' } } PSNote( [object]$object ){ $this.Note = $object.Note $this.Snippet = $object.Snippet $this.Details = $object.Details $this.Action = $object.Action $this.Alias = $object.Alias $this.Tags = $object.Tags $this.File = $object.File if([string]::IsNullOrEmpty($this.Alias)){ $this.Alias = $object.Note } if([string]::IsNullOrEmpty($this.Action)){ $this.Action = 'Display' } } } class PSNoteSearch { [string]$Note [string]$Snippet [string]$Details [string]$Action [string]$Alias [string[]]$Tags [string]$file PSNoteSearch( [object]$object ){ $this.Note = $object.Note $this.Snippet = $object.Snippet $this.Details = $object.Details $this.Action = $object.Action $this.Alias = $object.Alias $this.Tags = $object.Tags $this.File = $object.File if([string]::IsNullOrEmpty($this.Alias)){ $this.Alias = $object.Note } } } class PSNoteExport { [string]$Note [string]$Snippet [string]$Details [string]$Action [string]$Alias [string[]]$Tags PSNoteExport( [object]$object ){ $this.Note = $object.Note $this.Snippet = $object.Snippet $this.Details = $object.Details $this.Action = $object.Action $this.Alias = $object.Alias $this.Tags = $object.Tags if([string]::IsNullOrEmpty($this.Alias)){ $this.Alias = $object.Note } if([string]::IsNullOrEmpty($this.Action)){ $this.Action = 'Display' } } } |