Samsung Magician

Page 84 of 127 FirstFirst ... 3474828384858694 ... LastLast

  1. Posts : 27,181
    Win11 Pro, Win10 Pro N, Win10 Home, Windows 8.1 Pro, Ubuntu
    Thread Starter
       #831

    Almighty1 said:
    Pretty awesome, what is even more awesome is how you did the Good Afternoon Greeting... I seem to have a pretty big trim as it is all the free space available which is 1.3TB.
    That was something @Kari showed me how to do once, I believe it was for a reminder for the upcoming Anniversary Update at the time, after which I changed the text and target date.
    You need one for PowerShell and PowerShell ISE
    Samsung Magician-image.png
      My Computers


  2. Posts : 17,661
    Windows 10 Pro
       #832

    Cliff S said:
    That was something @Kari showed me how to do once, I believe it was for a reminder for the upcoming Anniversary Update at the time, after which I changed the text and target date.
    At the time when I showed how to do it, we were counting days to release of Anniversary Update, I just added a countdown to script :).

    Anyway, the purpose was to show how to do a basic PowerShell script. This script sets working folder to whatever you want to when you launch PowerShell, be it in normal or elevated mode. It also shows how to do "If A, then B, else C" in PS script, and how to handel 12 and 24 hour time .
    Script:

    Code:
    $Hour = Get-Date -Format "HH:mm"
    $Now = Get-Date -Format "HH:mm (h:mm tt)"
    If ($Hour -lt "06:00")
        {Write-Host "It's quite late" $env:username". The time is "$Now}
    ElseIf ($Hour -lt "12:00")
        {Write-Host "Good morning" $env:username". The time is "$Now}
    ElseIf ($Hour -lt "18:00")
        {Write-Host "Good afternoon" $env:username". The time is "$Now}
    ElseIf ($Hour -ge "18:00")
        {Write-Host "Good evening" $env:username". The time is "$Now}
    Write-Host
    Set-Location $env:USERPROFILE

    Save as Microsoft.PowerShell_profile.ps1 in folder %userprofile%\Documents\WindowsPowerShell for PowerShellShell, as Microsoft.PowerShellISE_profile.ps1 (letters ISE added to filename).

    Result:

    Samsung Magician-image.png

    Script also works when powershell session is started in Command Prompt:

    Samsung Magician-image.png

    If the script asks if you want to run it every time you open PS, enable running local scripts:

    Samsung Magician-image.png

    Kari
      My Computer


  3. Posts : 1,091
    Windows XP/7/8/8.1/10, Linux, Android, FreeBSD Unix
       #833

    Thanks Cliff S and Kari for taking the time to answer that one, how does one do the countdown timer?
      My Computer


  4. Posts : 27,181
    Win11 Pro, Win10 Pro N, Win10 Home, Windows 8.1 Pro, Ubuntu
    Thread Starter
       #834

    Almighty1 said:
    Thanks Cliff S and Kari for taking the time to answer that one, how does one do the countdown timer?
    Follow Kari's instructions step for step.

    Here is a copy of mine, open it in Notepad and make any needed text changes(like your name, birthdate or event, and the user folder address):
    Microsoft.PowerShellISE_profile.zip

      My Computers


  5. Posts : 1,091
    Windows XP/7/8/8.1/10, Linux, Android, FreeBSD Unix
       #835

    Thanks Cliff S, I edited your script except the countdown results is wrong, it should be 161 days, not sure what I am doing wrong. This is my script:

    Code:
    $Hour = Get-Date -Format "HH:mm"
    $Now = Get-Date -Format "HH:mm (h:mm tt)"
    $January01 = "01 January 2018"
    $NewYear = [system.datetime]$January01
    $Today = Get-Date 
    $ToGo = ($NewYear.DayOfYear - $Today.DayOfYear)
    If ($Hour -lt "06:00")
        {Write-Host "It's quite late Almighty1. The time is"$Now}
    ElseIf ($Hour -lt "12:00")
        {Write-Host "Good morning Almighty1. The time is"$Now}
    ElseIf ($Hour -lt "18:00")
        {Write-Host "Good afternoon Almighty1. The time is"$Now}
    ElseIf ($Hour -ge "18:00")
        {Write-Host "Good evening Almighty1. The time is"$Now}
    Write-Host $ToGo "days to go until 2018!"
    Write-Host
    when I run it, it says:
    Windows PowerShell
    Copyright (C) 2016 Microsoft Corporation. All rights reserved.

    Good morning Almighty1. The time is 07:50 (7:50 AM)
    -203 days to go until 2018!

    PS C:\WINDOWS\system32>
      My Computer


  6. Posts : 5,478
    2004
       #836

    Almighty1 said:
    Thanks Cliff S, I edited your script except the countdown results is wrong, it should be 161 days, not sure what I am doing wrong.
    You are taking DayOfYear for new years day (which is 1) and subtracting todays DayOfYear (204).
    Code:
    PS C:\WINDOWS\system32> $NewYear.DayOfYear
    1
    PS C:\WINDOWS\system32> $Today.DayOfYear
    204
    1 - 204 = -203 which is what you are seeing. Your script above only works if the date you are comparing is further on in the same year.

    Drop the DayOfYear from the calculation as you don't want it - like this
    Code:
    PS C:\WINDOWS\system32> $ToGo = $NewYear - $Today
    This gives you various options to display...
    Code:
    PS C:\WINDOWS\system32> $ToGo
    
    
    Days              : 161
    Hours             : 6
    Minutes           : 52
    Seconds           : 54
    Milliseconds      : 268
    Ticks             : 139351742683404
    TotalDays         : 161.286739216903
    TotalHours        : 3870.88174120567
    TotalMinutes      : 232252.90447234
    TotalSeconds      : 13935174.2683404
    TotalMilliseconds : 13935174268.3404
    
    
    PS C:\WINDOWS\system32> Write-Host $ToGo "to go until 2018!"
    161.06:52:54.2683404 to go until 2018!
    PS C:\WINDOWS\system32> Write-Host $ToGo.Days "days to go until 2018!"
    161 days to go until 2018!
    PS C:\WINDOWS\system32> Write-Host $ToGo.TotalSeconds "seconds to go until 2018!"
    13935174.2683404 seconds to go until 2018!
    Last edited by lx07; 23 Jul 2017 at 10:44.
      My Computer


  7. Posts : 1,091
    Windows XP/7/8/8.1/10, Linux, Android, FreeBSD Unix
       #837

    Thanks lx07! That makes sense, was confused since Cliff's original script was for his next birthday which is still in 2017 as it didn't happen yet.
      My Computer


  8. Posts : 19
    Win 10 Pro
       #838

    Sooo,

    Magician is safe to disable, right? Like, I have AHCI and TRIM enabled, but disabling run at startup won't change that? After I've set it up, it's basically just a monitoring tool, correct? Like, it doesn't do anything on like a driver level?
    Or something with caching?
      My Computer


  9. Posts : 27,181
    Win11 Pro, Win10 Pro N, Win10 Home, Windows 8.1 Pro, Ubuntu
    Thread Starter
       #839

    rEEEEleaseMEE said:
    Sooo,

    Magician is safe to disable, right? Like, I have AHCI and TRIM enabled, but disabling run at startup won't change that? After I've set it up, it's basically just a monitoring tool, correct? Like, it doesn't do anything on like a driver level?
    Or something with caching?
    All it does in your system try is check for firmware update every so often. I keep it turned off, and then check once a month, or when ever I think about it.
      My Computers


  10. Posts : 26,440
    Windows 11 Pro 22631.3447
       #840

    It causes problems with new builds, I Have to turn off Rapid Mode or the build will fail.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:53.
Find Us




Windows 10 Forums