title: Add PS Profile to a new local user
body: <p>I want to create a Powershell profile for a new local user. This new local user is just a copy of Administrator account.</p>
  
  <p>My function function works when profile has been initialized. But it don't work when the Windows profile is not created yet (user still not logged in since the creation of account).</p>
  
  <p>Here is my try:</p>
  
  <pre><code>function add-PSProfile
  {
      [CmdletBinding()]
      Param
      (
          [Parameter( Mandatory=$true )]
          $Login,
          [Parameter( Mandatory=$true )]
          [ValidateScript({Test-Path $_})]
          $RemoteProfilePath
      )
  
      # Get default profiles directory
      $ProfilesDirectory = ( Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' -ErrorAction Stop ).ProfilesDirectory
  
      $ProfilePath       = Join-Path $ProfilesDirectory $Login
      $PSProfilePath     = Join-Path $ProfilePath 'Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'
  
      if( -not ( Test-Path $PSProfilePath ) )
      {
          New-Item -ItemType File -Path $PSProfilePath -Force
      }
  
      Copy-Item $RemoteProfilePath $PSProfilePath
  }
  </code></pre>
  
  <p>Do you have any suggestion?
  Thanks for your help :)</p>