Skip to content

Die KW 30/2020 im Link-Rückblick

Die KW 29/2020 im Link-Rückblick

Create and manage a shadow copy snapshot for windows with powershell

Following my essence about the topic of creating a shadow copy snapshot.

#bo:create shadow copy
$shadowSourceVolume = ($env:SystemDrive + "\")
$shadowDestinationLinkPath = ($env:SystemDrive + "\shadowed_test")

#@see: https://docs.microsoft.com/en-us/previous-versions/windows/desktop/vsswmi/create-method-in-class-win32-shadowcopy#examples
$shadowCopyClass=[WMICLASS]"root\cimv2:win32_shadowcopy";

#create a shadow copy object
$shadowCopyObject = $shadowCopyClass.create($shadowSourceVolume, "ClientAccessible")
#fetch shadow object fron that
$shadowObject = Get-WmiObject Win32_ShadowCopy | Where-Object { $_.ID -eq $shadowCopyObject.ShadowID }
#fetch 
$shadowLinkPath = $shadowObject.DeviceObject + "\"
#eo:create shadow copy

#bo:create link
cmd /c mklink /d $shadowDestinationLinkPath $shadowLinkPath
#eo:create link

#bo: remove shadow link
cmd /c rmdir /S /Q $shadowDestinationLinkPath
#eo: remove shadow link

#bo: delete shadow copy
$shadowObject.Delete();
#Remove-CimInstance -InputObject $shadowObject
#eo: delete shadow copy

#bo: FTL
#list all available shadow copies
#Get-WmiObject Win32_Shadowcopy
#eo: FTL

Most important learned knowledge for me is that I only can create a snapshot of a whole volume.

Translate to de es fr it pt ja

Simple PowerShell Log Function

Just to share it somewhere with someone, following my powershell basic log function.

Function Log-Message {
    [cmdletbinding()]
    Param (
        [parameter(Mandatory=$true)] [string] $Message,
        [string] $LogLevel = "info"
    )

    $currentDate = Get-Date -Format "yyyyMMdd"
    $currentTime = Get-Date -Format "HHmmss"

    $logMessage = '{0} {1} [{2}]: {3}' -f $currentDate,$currentTime,$logLevel,$message

    $logMessage >> $logFile
}

Enjoy it.

Translate to de es fr it pt ja

Die KW 28/2020 im Link-Rückblick

`error: archzfs: signature from "ArchZFS Bot <[email protected]>" is unknown trust` and how to solve it

I ran into this error error: archzfs: signature from "ArchZFS Bot <[email protected]>" is unknown trust on multiple machines over the last days.

Since one machine was working which is also running one of my dns servers, I was searching into this direction. After a while, I switched all my machines using this one dns server without fixing the real issue. Furthermore, by just trying to refresh keys with sudo pacman-key --refresh-keys, I ran into another error: gpg: WARNING: Tor is not running.

I could solve this with a one liner:

echo "no-use-tor" >> ~/.gnupg/dirmngr.conf

Next step was finally to delete the broken key and re-import ist again.

sudo pacman-key -d DDF7DB817396A49B2A2723F7403BD972F75D9D76
sudo pacman-key -r DDF7DB817396A49B2A2723F7403BD972F75D9D76
sudo pacman-key --lsign-key DDF7DB817396A49B2A2723F7403BD972F75D9D76

After running through all this steps, I was able to run a system update again with pacman.

Thanks to this issue report on github, this entry on redit and this entry on gnupg.org.

Translate to de es fr it pt ja

Die KW 27/2020 im Link-Rückblick