GeneralFunctions.ps1

<#
    .NOTES
    ===========================================================================
    Created on: 12/29/2016 2:46 PM
    Created by: Vikas Sukhija
    Organization: https://techwizard.cloud
    Filename: Generalutilities.ps1
    Update: 7/15/2020 Converted to module
    Update: 7/23/2020 updated getauth with validation script
    update: 7/25/2020 rmeoved move-file unused function
    update: 7/25/2020 added read ini contnet function
    update: 7/25/2020 added save-encrypt function
    update: 9/2/2020 added new-randompassword function
    update: 9/16/2020 added get-adrecursive group function
    update: 12/30/2020 added get-adusermemberof function
    update: 4/28/2021 updated Get-ADGroupMembersRecursive function to include groups
    update: 4/1/2022 updated random password to atke any number of chars
    update: 6/8/2022 ADDED Set-IniContent and Out-IniFile from author Sean Seymour <seanjseymour@gmail.com> based on work by Oliver Lipkau <oliver@lipkau.net>
    update: 6/24/2022 ADDED Start-Maintenance Function
    update: 12/20/2022 ADDED Get-FailedScheduledTasks
    ===========================================================================
    .DESCRIPTION
    General Utilities
#>

######################get AD User member Of######################
Function Get-ADUserMemberOf
{
  Param(
    [Parameter(Mandatory = $true)]
    [ValidateNotNullOrEmpty()]
    [String]$User,
    [Parameter(Mandatory = $true)]
    [ValidateNotNullOrEmpty()]
    [String]$Group
  )
  try{
    $GroupDN = (Get-ADGroup $Group).DistinguishedName
    $UserDN = (Get-ADUser $User).DistinguishedName
    $Getaduser = Get-ADUser -Filter "memberOf -RecursiveMatch '$GroupDN'" -SearchBase $UserDN
    If($Getaduser) {
      $true
    }
    Else { 
      $false 
    }
  }
  catch{

  }
} #Get-ADUserMemberOf
######################get AD recursive group membership######################
Function Get-ADGroupMembersRecursive{
  Param(
    [Parameter(Mandatory = $true,ValueFromPipeline=$true)]
    [ValidateNotNullOrEmpty()]
    [String[]]$Groups,
    [ValidateNotNullOrEmpty()]
    [String[]]$Properties,
    [ValidateSet($true,$false)]
    [string]$ShowGroups
  )
  Begin{
    $Results = @()
    [String[]]$defaultproperties = "distinguishedName","name","objectClass","objectGUID","SamAccountName","SID"
    $Properties+=$defaultproperties
    $Properties = $Properties | Sort-Object -Unique
  }
  Process{
    ForEach($adobj in $Groups){
      $getgroupdn =  (Get-ADGroup -identity $adobj).DistinguishedName
      $findallgroups = Get-ADGroup -identity $getgroupdn -Properties members| Select-Object -ExpandProperty members | get-adobject | Where-Object{$_.objectClass -eq "Group"} |Select DistinguishedName
      $Results+=$getgroupdn
      ForEach($Object in $findallgroups){
        if($ShowGroups -eq $true){
          Get-ADGroupMembersRecursive $Object.DistinguishedName -Properties $Properties -ShowGroups $true
        }
        else{
          Get-ADGroupMembersRecursive $Object.DistinguishedName -Properties $Properties
        }
      }
    }
  }
  End{
    $Results = $Results | Select-Object -Unique
    foreach($item in $Results){
      $arrgroupmembers =@()
      if($ShowGroups -eq $true){
        Get-ADGroup -id $item -Properties $Properties | Select-Object $Properties
      }
      $arrgroupmembers = Get-ADGroup -id $item -Properties members | Select-Object -ExpandProperty members |get-adobject | Where-Object{$_.objectClass -eq "user"} | Get-ADUser -properties $Properties | Select-Object $Properties
      $arrgroupmembers
    }
  }
} #Get-ADGroupMembersRecursive


######################Authentication Function##################################
Function Get-Auth
{
  [CmdletBinding()]
  param
  (
    [Parameter(Mandatory = $true,ParameterSetName = 'file')]
    [Parameter(Mandatory = $true,ParameterSetName = 'encrypt')]
    $userId,
    [Parameter(Mandatory = $true,ParameterSetName = 'file')]
    [ValidateScript({
          if(-Not ($_ | Test-Path) ){throw "File or folder does not exist"}
          if(-Not ($_ | Test-Path -PathType Leaf) ){throw "The Path argument must be a file. Folder paths are not allowed."}
          if($_ -notmatch "(\.txt)"){throw "The file specified in the path argument must be either of type txt"}
          return $true 
    })]
    [System.IO.FileInfo]$passwordfile,
    [Parameter(ParameterSetName = 'file',Position = 0)][switch]$file,
    

    
    [Parameter(ParameterSetName = 'encrypt',Position = 0)][switch]$encrypt,
    [Parameter(Mandatory = $true,ParameterSetName = 'encrypt')]
    [string]$password
  )
    
  switch ($PsCmdlet.ParameterSetName) {
    "file"{
      $encrypted1 = Get-Content $passwordfile
      $pwd = ConvertTo-SecureString -string $encrypted1
      $Credential = New-Object System.Management.Automation.PSCredential -ArgumentList $userId, $pwd
      return $pwd, $Credential
    }
    "encrypt"{
      $pwd = ConvertTo-SecureString -string $password
      $Credential = New-Object System.Management.Automation.PSCredential -ArgumentList $userId, $pwd
      return $pwd, $Credential
    }
  }
}#get-auth

######################Failed Scheduled Tasks##################################
function Get-FailedScheduledTasks
{
    Param(
    [Parameter(Mandatory = $true)]
    [ValidateNotNullOrEmpty()]
    [String[]]$includepaths
  )  
    $excludedTaskResults=@(
      0, # success
      267009, # running
      267010, # disabled
      267011, # not yet ran
      267012, # There are no more runs scheduled for this task
      267014, # The last run of the task was terminated by the user
      267015, # Either the task has no triggers or the existing triggers are disabled or not set
      2147750687, # An instance of this task is already running
      3221225786, # The application terminated as a result of a CTRL+C
      1073807364, # 40010004 (hex). The system cannot open a file. This can safely be ignored as it normally pertains to CreateExplorerShellUnelevatedTask
      2147943517 # Firefox Default Browser Agent
      )
    $excludedStates=@('Disabled','Running')
    $customTasks=Get-ScheduledTask | Where-Object{ $_.State -notin $excludedStates -and $includepaths -contains ($_.TaskPath).replace("\","") }
    $failedTasks=$customTasks|Get-ScheduledTaskInfo | Where-Object{$_.LastTaskResult -notin $excludedTaskResults}
    if($failedTasks){
      return $failedTasks|Select-Object -Property * -ExcludeProperty PSComputerName,CimClass,CimInstanceProperties,CimSystemProperties
    }
  }
######################read INI files##################################
Function Get-IniContent 
{
  [CmdletBinding()]  
  Param(  
    [ValidateNotNullOrEmpty()]  
    [ValidateScript({(Test-Path $_) -and ((Get-Item $_).Extension -eq ".ini")})]  
    [Parameter(ValueFromPipeline = $true,Mandatory = $true)]  
    [string]$FilePath  
  )  
      
  Begin  
  {Write-Verbose -Message "$($MyInvocation.MyCommand.Name):: Function started"}  
          
  Process  
  {  
    Write-Verbose -Message "$($MyInvocation.MyCommand.Name):: Processing file: $FilePath"  
              
    $ini = @{}  
    switch -regex -file $FilePath  
    {  
      "^\[(.+)\]$" # Section
      {  
        $section = $matches[1]  
        $ini[$section] = @{}  
        $CommentCount = 0  
      }  
      "^(;.*)$" # Comment
      {  
        if (!($section))  
        {  
          $section = "No-Section"  
          $ini[$section] = @{}  
        }  
        $value = $matches[1]  
        $CommentCount = $CommentCount + 1  
        $Name = "Comment" + $CommentCount  
        $ini[$section][$Name] = $value  
      }   
      "(.+?)\s*=\s*(.*)" # Key
      {  
        if (!($section))  
        {  
          $section = "No-Section"  
          $ini[$section] = @{}  
        }  
        $Name, $value = $matches[1..2]  
        $ini[$section][$Name] = $value  
      }  
    }  
    Write-Verbose -Message "$($MyInvocation.MyCommand.Name):: Finished Processing file: $FilePath"  
    Return $ini  
  }  
          
  End  
  {Write-Verbose -Message "$($MyInvocation.MyCommand.Name):: Function ended"}  
} #get-inicontent
##################Set-Inicontent################################################
Function Set-IniContent {
    <#
    .Synopsis
        Updates existing values or adds new key-value pairs to an INI file
 
    .Description
        Updates specified keys to new values in all sections or certain sections.
        Used to add new or change existing values. To comment, uncomment or remove keys use the related functions instead.
        The ini source can be specified by a file or piped in by the result of Get-IniContent.
        The modified content is returned as a ordered dictionary hashtable and can be piped to a file with Out-IniFile.
 
    .Notes
        Author : Sean Seymour <seanjseymour@gmail.com> based on work by Oliver Lipkau <oliver@lipkau.net>
        Source : https://github.com/lipkau/PsIni
                      http://gallery.technet.microsoft.com/scriptcenter/ea40c1ef-c856-434b-b8fb-ebd7a76e8d91
        Version : 1.0.0 - 2016/08/18 - SS - Initial release
                    : 1.0.1 - 2016/12/29 - SS - Removed need for delimiters by making Sections a string array
                                                and NameValuePairs a hashtable. Thanks Oliver!
 
        #Requires -Version 2.0
 
    .Inputs
        System.String
        System.Collections.IDictionary
 
    .Outputs
        System.Collections.Specialized.OrderedDictionary
 
    .Example
        $ini = Set-IniContent -FilePath "C:\myinifile.ini" -Sections 'Printers' -NameValuePairs @{'Name With Space' = 'Value1' ; 'AnotherName' = 'Value2'}
        -----------
        Description
        Reads in the INI File c:\myinifile.ini, adds or updates the 'Name With Space' and 'AnotherName' keys in the [Printers] section to the values specified,
        and saves the modified ini to $ini.
 
    .Example
        Set-IniContent -FilePath "C:\myinifile.ini" -Sections 'Terminals','Monitors' -NameValuePairs @{'Updated=FY17Q2'} | Out-IniFile "C:\myinifile.ini" -Force
        -----------
        Description
        Reads in the INI File c:\myinifile.ini and adds or updates the 'Updated' key in the [Terminals] and [Monitors] sections to the value specified.
        The ini is then piped to Out-IniFile to write the INI File to c:\myinifile.ini. If the file is already present it will be overwritten.
 
    .Example
        Get-IniContent "C:\myinifile.ini" | Set-IniContent -NameValuePairs @{'Headers' = 'True' ; 'Update' = 'False'} | Out-IniFile "C:\myinifile.ini" -Force
        -----------
        Description
        Reads in the INI File c:\myinifile.ini using Get-IniContent, which is then piped to Set-IniContent to add or update the 'Headers' and 'Update' keys in all sections
        to the specified values. The ini is then piped to Out-IniFile to write the INI File to c:\myinifile.ini. If the file is already present it will be overwritten.
 
    .Example
        Get-IniContent "C:\myinifile.ini" | Set-IniContent -NameValuePairs @{'Updated'='FY17Q2'} -Sections '_' | Out-IniFile "C:\myinifile.ini" -Force
        -----------
        Description
        Reads in the INI File c:\myinifile.ini using Get-IniContent, which is then piped to Set-IniContent to add or update the 'Updated' key that
        is orphaned, i.e. not specifically in a section. The ini is then piped to Out-IniFile to write the INI File to c:\myinifile.ini.
 
    .Link
        Get-IniContent
        Out-IniFile
    #>


    [CmdletBinding(DefaultParameterSetName = "File")]
    [OutputType(
        [System.Collections.IDictionary]
    )]
    Param
    (
        # Specifies the path to the input file.
        [Parameter( Position = 0, Mandatory = $true, ParameterSetName = "File" )]
        [ValidateNotNullOrEmpty()]
        [String]
        $FilePath,

        # Specifies the Hashtable to be modified.
        # Enter a variable that contains the objects or type a command or expression that gets the objects.
        [Parameter( Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = "Object")]
        [ValidateNotNullOrEmpty()]
        [System.Collections.IDictionary]
        $InputObject,

        # Hashtable of one or more key names and values to modify. Required.
        [Parameter( Mandatory = $true, ParameterSetName = "File")]
        [Parameter( Mandatory = $true, ParameterSetName = "Object")]
        [ValidateNotNullOrEmpty()]
        [HashTable]
        $NameValuePairs,

        # String array of one or more sections to limit the changes to, separated by a comma.
        # Surrounding section names with square brackets is not necessary but is supported.
        # Ini keys that do not have a defined section can be modified by specifying '_' (underscore) for the section.
        [Parameter( ParameterSetName = "File" )]
        [Parameter( ParameterSetName = "Object" )]
        [ValidateNotNullOrEmpty()]
        [String[]]
        $Sections
    )

    Begin {
        Write-Debug "PsBoundParameters:"
        $PSBoundParameters.GetEnumerator() | ForEach-Object { Write-Debug $_ }
        if ($PSBoundParameters['Debug']) {
            $DebugPreference = 'Continue'
        }
        Write-Debug "DebugPreference: $DebugPreference"
        Write-Verbose "$($MyInvocation.MyCommand.Name):: Function started"

        # Update or add the name/value pairs to the section.
        Function Update-IniEntry {
            param ($content, $section)

            foreach ($pair in $NameValuePairs.GetEnumerator()) {
                if (!($content[$section])) {
                    Write-Verbose ("$($MyInvocation.MyCommand.Name):: '{0}' section does not exist, creating it." -f $section)
                    $content[$section] = New-Object System.Collections.Specialized.OrderedDictionary([System.StringComparer]::OrdinalIgnoreCase)
                }

                Write-Verbose ("$($MyInvocation.MyCommand.Name):: Setting '{0}' key in section {1} to '{2}'." -f $pair.key, $section, $pair.value)
                $content[$section][$pair.key] = $pair.value
            }
        }
    }
    # Update the specified keys in the list, either in the specified section or in all sections.
    Process {
        # Get the ini from either a file or object passed in.
        if ($PSCmdlet.ParameterSetName -eq 'File') { $content = Get-IniContent $FilePath }
        if ($PSCmdlet.ParameterSetName -eq 'Object') { $content = $InputObject }

        # Specific section(s) were requested.
        if ($Sections) {
            foreach ($section in $Sections) {
                # Get rid of whitespace and section brackets.
                $section = $section.Trim() -replace '[][]', ''

                Write-Debug ("Processing '{0}' section." -f $section)

                Update-IniEntry $content $section
            }
        }
        else {
            # No section supplied, go through the entire ini since changes apply to all sections.
            foreach ($item in $content.GetEnumerator()) {
                $section = $item.key

                Write-Debug ("Processing '{0}' section." -f $section)

                Update-IniEntry $content $section
            }
        }
        Write-Output $content
    }
    End {
        Write-Verbose "$($MyInvocation.MyCommand.Name):: Function ended"
    }
}
###########################out-ini#############################################
Function Out-IniFile {
    <#
    .Synopsis
        Write hash content to INI file
 
    .Description
        Write hash content to INI file
 
    .Notes
        Author : Oliver Lipkau <oliver@lipkau.net>
        Blog : http://oliver.lipkau.net/blog/
        Source : https://github.com/lipkau/PsIni
                      http://gallery.technet.microsoft.com/scriptcenter/ea40c1ef-c856-434b-b8fb-ebd7a76e8d91
 
        #Requires -Version 2.0
 
    .Inputs
        System.String
        System.Collections.IDictionary
 
    .Outputs
        System.IO.FileSystemInfo
 
    .Example
        Out-IniFile $IniVar "C:\myinifile.ini"
        -----------
        Description
        Saves the content of the $IniVar Hashtable to the INI File c:\myinifile.ini
 
    .Example
        $IniVar | Out-IniFile "C:\myinifile.ini" -Force
        -----------
        Description
        Saves the content of the $IniVar Hashtable to the INI File c:\myinifile.ini and overwrites the file if it is already present
 
    .Example
        $file = Out-IniFile $IniVar "C:\myinifile.ini" -PassThru
        -----------
        Description
        Saves the content of the $IniVar Hashtable to the INI File c:\myinifile.ini and saves the file into $file
 
    .Example
        $Category1 = @{“Key1”=”Value1”;”Key2”=”Value2”}
        $Category2 = @{“Key1”=”Value1”;”Key2”=”Value2”}
        $NewINIContent = @{“Category1”=$Category1;”Category2”=$Category2}
        Out-IniFile -InputObject $NewINIContent -FilePath "C:\MyNewFile.ini"
        -----------
        Description
        Creating a custom Hashtable and saving it to C:\MyNewFile.ini
    .Link
        Get-IniContent
    #>


    [CmdletBinding()]
    [OutputType(
        [System.IO.FileSystemInfo]
    )]
    Param(
        # Adds the output to the end of an existing file, instead of replacing the file contents.
        [switch]
        $Append,

        # Specifies the file encoding. The default is UTF8.
        #
        # Valid values are:
        # -- ASCII: Uses the encoding for the ASCII (7-bit) character set.
        # -- BigEndianUnicode: Encodes in UTF-16 format using the big-endian byte order.
        # -- Byte: Encodes a set of characters into a sequence of bytes.
        # -- String: Uses the encoding type for a string.
        # -- Unicode: Encodes in UTF-16 format using the little-endian byte order.
        # -- UTF7: Encodes in UTF-7 format.
        # -- UTF8: Encodes in UTF-8 format.
        [ValidateSet("Unicode", "UTF7", "UTF8", "ASCII", "BigEndianUnicode", "Byte", "String")]
        [Parameter()]
        [String]
        $Encoding = "UTF8",

        # Specifies the path to the output file.
        [ValidateNotNullOrEmpty()]
        [ValidateScript( {Test-Path $_ -IsValid} )]
        [Parameter( Position = 0, Mandatory = $true )]
        [String]
        $FilePath,

        # Allows the cmdlet to overwrite an existing read-only file. Even using the Force parameter, the cmdlet cannot override security restrictions.
        [Switch]
        $Force,

        # Specifies the Hashtable to be written to the file. Enter a variable that contains the objects or type a command or expression that gets the objects.
        [Parameter( Mandatory = $true, ValueFromPipeline = $true )]
        [System.Collections.IDictionary]
        $InputObject,

        # Passes an object representing the location to the pipeline. By default, this cmdlet does not generate any output.
        [Switch]
        $Passthru,

        # Adds spaces around the equal sign when writing the key = value
        [Switch]
        $Loose,

        # Writes the file as "pretty" as possible
        #
        # Adds an extra linebreak between Sections
        [Switch]
        $Pretty
    )

    Begin {
        Write-Debug "PsBoundParameters:"
        $PSBoundParameters.GetEnumerator() | ForEach-Object { Write-Debug $_ }
        if ($PSBoundParameters['Debug']) {
            $DebugPreference = 'Continue'
        }
        Write-Debug "DebugPreference: $DebugPreference"

        Write-Verbose "$($MyInvocation.MyCommand.Name):: Function started"

        function Out-Keys {
            param(
                [ValidateNotNullOrEmpty()]
                [Parameter( Mandatory, ValueFromPipeline )]
                [System.Collections.IDictionary]
                $InputObject,

                [ValidateSet("Unicode", "UTF7", "UTF8", "ASCII", "BigEndianUnicode", "Byte", "String")]
                [Parameter( Mandatory )]
                [string]
                $Encoding = "UTF8",

                [ValidateNotNullOrEmpty()]
                [ValidateScript( {Test-Path $_ -IsValid})]
                [Parameter( Mandatory, ValueFromPipelineByPropertyName )]
                [Alias("Path")]
                [string]
                $FilePath,

                [Parameter( Mandatory )]
                $Delimiter,

                [Parameter( Mandatory )]
                $MyInvocation
            )

            Process {
                if (!($InputObject.get_keys())) {
                    Write-Warning ("No data found in '{0}'." -f $FilePath)
                }
                Foreach ($key in $InputObject.get_keys()) {
                    if ($key -match "^Comment\d+") {
                        Write-Verbose "$($MyInvocation.MyCommand.Name):: Writing comment: $key"
                        "$($InputObject[$key])" | Out-File -Encoding $Encoding -FilePath $FilePath -Append
                    }
                    else {
                        Write-Verbose "$($MyInvocation.MyCommand.Name):: Writing key: $key"
                        $InputObject[$key] |
                            ForEach-Object { "$key$delimiter$_" } |
                            Out-File -Encoding $Encoding -FilePath $FilePath -Append
                    }
                }
            }
        }

        $delimiter = '='
        if ($Loose) {
            $delimiter = ' = '
        }

        # Splatting Parameters
        $parameters = @{
            Encoding = $Encoding;
            FilePath = $FilePath
        }

    }

    Process {
        $extraLF = ""

        if ($Append) {
            Write-Debug ("Appending to '{0}'." -f $FilePath)
            $outfile = Get-Item $FilePath
        }
        else {
            Write-Debug ("Creating new file '{0}'." -f $FilePath)
            $outFile = New-Item -ItemType file -Path $Filepath -Force:$Force
        }

        if (!(Test-Path $outFile.FullName)) {Throw "Could not create File"}

        Write-Verbose "$($MyInvocation.MyCommand.Name):: Writing to file: $Filepath"
        foreach ($i in $InputObject.get_keys()) {
            if (!($InputObject[$i].GetType().GetInterface('IDictionary'))) {
                #Key value pair
                Write-Verbose "$($MyInvocation.MyCommand.Name):: Writing key: $i"
                "$i$delimiter$($InputObject[$i])" | Out-File -Append @parameters

            }
            elseif ($i -eq $script:NoSection) {
                #Key value pair of NoSection
                Out-Keys $InputObject[$i] `
                    @parameters `
                    -Delimiter $delimiter `
                    -MyInvocation $MyInvocation
            }
            else {
                #Sections
                Write-Verbose "$($MyInvocation.MyCommand.Name):: Writing Section: [$i]"

                # Only write section, if it is not a dummy ($script:NoSection)
                if ($i -ne $script:NoSection) { "$extraLF[$i]"  | Out-File -Append @parameters }
                if ($Pretty) {
                    $extraLF = "`r`n"
                }

                if ( $InputObject[$i].Count) {
                    Out-Keys $InputObject[$i] `
                        @parameters `
                        -Delimiter $delimiter `
                        -MyInvocation $MyInvocation
                }

            }
        }
        Write-Verbose "$($MyInvocation.MyCommand.Name):: Finished Writing to file: $FilePath"
    }

    End {
        if ($PassThru) {
            Write-Debug ("Returning file due to PassThru argument.")
            Write-Output (Get-Item $outFile)
        }
        Write-Verbose "$($MyInvocation.MyCommand.Name):: Function ended"
    }
}
#############Checkgroup used for checking group in user acces extract###########
function Group-Validate
{
  [CmdletBinding()]
  param
  (
    [Parameter(Mandatory = $true,
    ValueFromPipelineByPropertyName = $true)]
    $User,
    [Parameter(Mandatory = $true)]
    $dom,
    $greport
  )
    
  begin
  {
    Write-Host "Start Checking objects for group validation" -ForegroundColor Green
    $coll = @()
    $cdom = $dom + "\" + "*"
  }
  process
  {
    if ($User -like $cdom)
    {
      $User = [string]$User
      try
      {if (Get-Group $User -ErrorAction Stop) { $coll += $User }}
      catch
      {
        Write-Host "$User is not a valid group" -ForegroundColor yellow
        Add-Content $greport $User
      }
    }
  }
  end
  {
    Write-Host "----------end---------------" -ForegroundColor Green
    return $coll
  }
}
 
#################Check if folder is created##################

function New-FolderCreation
{
  [CmdletBinding()]
  param
  (
    [Parameter(Mandatory = $true)]
    [string]$foldername
  )
    

  $logpath  = (Get-Location).path + "\" + "$foldername" 
  $testlogpath = Test-Path -Path $logpath
  if($testlogpath -eq $false)
  {
    #Start-ProgressBar -Title "Creating $foldername folder" -Timer 10
    $null = New-Item -Path (Get-Location).path -Name $foldername -Type directory
  }
}
#########Random Password##############
Function New-RandomPassword{
  [CmdletBinding()]
  param
  (
    [Parameter(Mandatory = $true)]
    [int]$NumberofChars
  )
  switch ($NumberofChars){
    $NumberofChars {
      $Password = $null
      $Password += ([char[]]([char]33..[char]122) | sort {Get-Random})[0..$NumberofChars] -join '' 
      $arrpassword = $Password.ToChararray()
      $randomarr = $arrpassword | Get-Random -Count $arrpassword.Length
      $Password = -join $randomarr
      return $Password
    }
  }
}
#######################Create Encryted password###############
Function Save-EncryptedPassword 
{
  [CmdletBinding()]
  param
  (
    [Parameter(Mandatory = $true)]
    [string]$password,
    [Parameter(Mandatory = $true)]
    [ValidateScript({
          if($_ -notmatch "(\.txt)"){throw "The file specified in the path argument must be either of type txt"}
          return $true 
    })]
    [System.IO.FileInfo]$path
  )
  $secure = ConvertTo-SecureString $password -force -asPlainText
  $bytes = ConvertFrom-SecureString $secure
  $bytes | Out-File $path -Encoding unicode
}#Save-EncryptedPassword
#######################Start Maintenance###########################
Function Start-Maintenance
{
  [CmdletBinding()]
  param
  (
    [Parameter(Mandatory = $true)]
    [string]$StartDay,
    [Parameter(Mandatory = $true)]
    [string]$EndDay,
    [Parameter(Mandatory = $true)]
    [string]$StartHour,
    [Parameter(Mandatory = $true)]
    [string]$EndHour,
    $logpath=$log
  )
  
  $currentdatetime =  Get-Date
  if($StartDay -eq $EndDay){
  if (($currentdatetime.DayOfweek -eq $StartDay) -and ($currentdatetime.TimeOfDay.Hours -gt $StartHour) -and ($currentdatetime.TimeOfDay.Hours -lt $EndHour)){
      Write-log -message "Exiting script - maintenance window - $currentdatetime" -path $logpath
      exit
  }
}else{
  if (($currentdatetime.DayOfweek -eq $StartDay) -and ($currentdatetime.TimeOfDay.Hours -ge $StartHour)){
      Write-log -message "Exiting script - maintenance window - $currentdatetime" -path $logpath
      exit
      }
  if (($currentdatetime.DayOfweek -eq $EndDay) -and ($currentdatetime.TimeOfDay.Hours -le $EndHour)){
      Write-log -message "Exiting script - maintenance window - $currentdatetime" -path $logpath
      exit
      }
}
}#Start-Maintenance
##########################################################################
# SIG # Begin signature block
# MIIjSQYJKoZIhvcNAQcCoIIjOjCCIzYCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUPrQKeOJk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