top of page

Using clip function on the powershell rocks

The process of moving your PowerShell scripts to Notion can be made easier by utilizing the 'clip' function which can be found at the end of your script. This function allows you to copy the contents of your script to the clipboard, which can then be pasted into Notion with ease. This can be especially helpful when dealing with large or complex scripts that would be difficult to manually transfer to Notion. By using the clip function, you can streamline your workflow and make the process of moving your PowerShell scripts to Notion more efficient and effortless.


For example my daily update script


choco upgrade all -y;Get-WindowsUpdate -AcceptAll -Install -AutoReboot; Get-EventLog -LogName System -EntryType Error -Newest 10 | Select-Object -Property * | clip


Output > Gets checked and fix the errors


EventID            : 11
MachineName        : w11h22may2023
Data               : {15, 0, 128, 0...}
Index              : 52602
Category           : (0)
CategoryNumber     : 0
EntryType          : Error
Message            : The driver detected a controller error on \Device\Harddisk5\DR5.
Source             : disk
ReplacementStrings : {\Device\Harddisk5\DR5}
InstanceId         : 3221487627
TimeGenerated      : 17/06/2023 17:47:22
TimeWritten        : 17/06/2023 17:47:22
UserName           : 
Site               : 
Container          : 

EventID            : 7034
MachineName        : w11h22may2023
Data               : {69, 0, 83, 0...}
Index              : 52578
Category           : (0)
CategoryNumber     : 0
EntryType          : Error
Message            : The Energy Server Service queencreek service terminated unexpectedly.  It has done this 1 time(s).
Source             : Service Control Manager
ReplacementStrings : {Energy Server Service queencreek, 1}
InstanceId         : 3221232506
TimeGenerated      : 17/06/2023 09:15:22
TimeWritten        : 17/06/2023 09:15:22
UserName           : 
Site               : 
Container          : 

EventID            : 10010
MachineName        : w11h22may2023
Data               : {}
Index              : 52488
Category           : (0)
CategoryNumber     : 0
EntryType          : Error
Message            : The description for Event ID '10010' in Source 'DCOM' cannot be found.  The local computer may 
                     not have the necessary registry information or message DLL files to display the message, or you 
                     may not have permission to access them.  The following information is part of the 
                     event:'{BC50CF2A-E12C-4F18-90CE-714CC8600CEE}'
Source             : DCOM
ReplacementStrings : {{BC50CF2A-E12C-4F18-90CE-714CC8600CEE}}
InstanceId         : 10010
TimeGenerated      : 16/06/2023 10:48:21
TimeWritten        : 16/06/2023 10:48:21
UserName           : NT AUTHORITY\SYSTEM
Site               : 
Container          : 

EventID            : 10010
MachineName        : w11h22may2023
Data               : {}
Index              : 52486
Category           : (0)
CategoryNumber     : 0
EntryType          : Error
Message            : The description for Event ID '10010' in Source 'DCOM' cannot be found.  The local computer may 
                     not have the necessary registry information or message DLL files to display the message, or you 
                     may not have permission to access them.  The following information is part of the 
                     event:'{8CFC164F-4BE5-4FDD-94E9-E2AF73ED4A19}'
Source             : DCOM
ReplacementStrings : {{8CFC164F-4BE5-4FDD-94E9-E2AF73ED4A19}}
InstanceId         : 10010
TimeGenerated      : 16/06/2023 10:48:13
TimeWritten        : 16/06/2023 10:48:13
UserName           : W11H22MAY2023\info
Site               : 
Container          : 

EventID            : 7009
MachineName        : w11h22may2023
Data               : {97, 0, 115, 0...}
Index              : 52485
Category           : (0)
CategoryNumber     : 0
EntryType          : Error
Message            : A timeout was reached (120000 milliseconds) while waiting for the ASUS Com Service service to 
                     connect.
Source             : Service Control Manager
ReplacementStrings : {120000, ASUS Com Service}
InstanceId         : 3221232481
TimeGenerated      : 16/06/2023 10:47:37
TimeWritten        : 16/06/2023 10:47:37
UserName           : 
Site               : 
Container          : 

EventID            : 1001
MachineName        : w11h22may2023
Data               : {}
Index              : 52392
Category           : (0)
CategoryNumber     : 0
EntryType          : Error
Message            : The description for Event ID '1001' in Source 'Microsoft-Windows-WER-SystemErrorReporting' cannot 
                     be found.  The local computer may not have the necessary registry information or message DLL 
                     files to display the message, or you may not have permission to access them.  The following 
                     information is part of the event:'0x00000050 (0xffff92052c6a1000, 0x0000000000000000, 
                     0xfffff80164141050, 0x0000000000000000)', 'C:\Windows\MEMORY.DMP', 
                     '330129d9-87e4-48d5-ad75-9c9191b26890'
Source             : Microsoft-Windows-WER-SystemErrorReporting
ReplacementStrings : {0x00000050 (0xffff92052c6a1000, 0x0000000000000000, 0xfffff80164141050, 0x0000000000000000), 
                     C:\Windows\MEMORY.DMP, 330129d9-87e4-48d5-ad75-9c9191b26890}
InstanceId         : 1001
TimeGenerated      : 16/06/2023 10:45:36
TimeWritten        : 16/06/2023 10:45:36
UserName           : NT AUTHORITY\SYSTEM
Site               : 
Container          : 

EventID            : 162
MachineName        : w11h22may2023
Data               : {0, 0, 0, 0...}
Index              : 52201
Category           : (0)
CategoryNumber     : 0
EntryType          : Error
Message            : Dump file generation succeded.
Source             : volmgr
ReplacementStrings : {\Device\HarddiskVolume8}
InstanceId         : 262306
TimeGenerated      : 16/06/2023 10:45:25
TimeWritten        : 16/06/2023 10:45:25
UserName           : 
Site               : 
Container          : 

EventID            : 161
MachineName        : w11h22may2023
Data               : {0, 0, 0, 0...}
Index              : 52200
Category           : (0)
CategoryNumber     : 0
EntryType          : Error
Message            : Dump file creation failed due to error during dump creation.
Source             : volmgr
ReplacementStrings : {\Device\HarddiskVolume8}
InstanceId         : 3221487777
TimeGenerated      : 16/06/2023 10:45:25
TimeWritten        : 16/06/2023 10:45:25
UserName           : 
Site               : 
Container          : 

EventID            : 6008
MachineName        : w11h22may2023
Data               : {231, 7, 6, 0...}
Index              : 52189
Category           : (0)
CategoryNumber     : 0
EntryType          : Error
Message            : The previous system shutdown at 10:02:47 AM on ?6/?16/?2023 was unexpected.
Source             : EventLog
ReplacementStrings : {10:02:47 AM, ?6/?16/?2023, , ...}
InstanceId         : 2147489656
TimeGenerated      : 16/06/2023 10:45:34
TimeWritten        : 16/06/2023 10:45:34
UserName           : 
Site               : 
Container          : 




4 views0 comments

Recent Posts

See All

Git migrations and what to look for

https://www.loom.com/share/dcdb002cb5b14259bf7bc8ca961e15fb How did i do the git transformation ? 0:00 Make sure that they are able to use other DevOps, so that was the main engagement there but doing

bottom of page